Re: Remove unnecessary code from psql's watch command

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Yugo NAGATA <nagata(at)sraoss(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Remove unnecessary code from psql's watch command
Date: 2024-03-05 23:11:15
Message-ID: Zeemk0eJoucp4zVx@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Mar 05, 2024 at 10:05:52PM +0900, Yugo NAGATA wrote:
> In the current code of do_watch(), sigsetjmp is called if WIN32
> is defined, but siglongjmp is not called in the signal handler
> in this condition. On Windows, currently, cancellation is checked
> only by cancel_pressed, and calling sigsetjmp in do_watch() is
> unnecessary. Therefore, we can remove code around sigsetjmp in
> do_watch(). I've attached the patch for this fix.

Re-reading the top comment of sigint_interrupt_enabled, it looks like
you're right here. As long as we check for cancel_pressed there
should be no need for any special cancellation handling here.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2024-03-05 23:13:46 Re: pg_upgrade --copy-file-range
Previous Message Tristan Partin 2024-03-05 23:02:55 Re: Refactoring backend fork+exec code