Fix pool_signal.
authorTatsuo Ishii <ishii@postgresql.org>
Sun, 12 Jan 2025 05:22:37 +0000 (14:22 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Mon, 13 Jan 2025 05:57:02 +0000 (14:57 +0900)
Previously pool_signal did not set SA_RESTART flag.  Thus any system
calls interrupted by a signal does not restart. Some of our code are
prepared so that they restart if a system call is interrupted by a
signal. But not sure all places are prepared too. So add the
flag. Note, PostgreSQL always uses the flag.

src/utils/pool_signal.c

index 6d6f4672e81aba2f4b1ad9a9c3badc4a33b2771e..b336a88b9a1a27588d6657862be9c4bf05d1381f 100644 (file)
@@ -145,9 +145,7 @@ pool_signal(int signo, pool_sighandler_t func)
 
        act.sa_handler = func;
        sigemptyset(&act.sa_mask);
-       act.sa_flags = 0;
-       if (signo != SIGALRM)
-               act.sa_flags |= SA_RESTART;
+       act.sa_flags = SA_RESTART;
 #ifdef SA_NOCLDSTOP
        if (signo == SIGCHLD)
                act.sa_flags |= SA_NOCLDSTOP;