Fix pool_signal.
authorTatsuo Ishii <ishii@postgresql.org>
Sun, 12 Jan 2025 05:22:37 +0000 (14:22 +0900)
committerTatsuo Ishii <ishii@postgresql.org>
Sun, 12 Jan 2025 05:22:37 +0000 (14:22 +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 c4cdd6db1b6bcd4e856f92eb9bda73742ad1de16..f30493ae20c8f11d490a826d17d540bc7a3df3cb 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;