summaryrefslogtreecommitdiff
path: root/src/include/port.h
diff options
context:
space:
mode:
authorNathan Bossart2025-01-16 22:41:05 +0000
committerNathan Bossart2025-01-16 22:41:05 +0000
commitd4a43b283751b23d32bbfa1ecc2cad2d16e3dde9 (patch)
tree36e0108d7c403b29727007b30bb53f1940e7cf09 /src/include/port.h
parent5cda4fdb0beb64453b634d0ab966912965c7b8f6 (diff)
Convert libpgport's pqsignal() to a void function.
The protections added by commit 3b00fdba9f introduced race conditions to this function that can lead to bogus return values. Since nobody seems to inspect the return value, this is of little consequence, but it would have been nice to convert it to a void function to avoid any possibility of a bogus return value. I originally thought that doing so would have required also modifying legacy-pqsignal.c's version of the function (which would've required an SONAME bump), but commit 9a45a89c38 gave legacy-pqsignal.c its own dedicated extern for pqsignal(), thereby decoupling it enough that libpgport's pqsignal() can be modified. This commit also adds an assertion for the return value of sigaction()/signal(). Since a failure most likely indicates a coding error, and nobody has ever bothered to check pqsignal()'s return value, it's probably not worth the effort to do anything fancier. Reviewed-by: Tom Lane Discussion: https://postgr.es/m/Z4chOKfnthRH71mw%40nathan
Diffstat (limited to 'src/include/port.h')
-rw-r--r--src/include/port.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/port.h b/src/include/port.h
index f0e28ce5c53..4e9e5657872 100644
--- a/src/include/port.h
+++ b/src/include/port.h
@@ -520,7 +520,7 @@ extern int pg_mkdir_p(char *path, int omode);
#define pqsignal pqsignal_be
#endif
typedef void (*pqsigfunc) (SIGNAL_ARGS);
-extern pqsigfunc pqsignal(int signo, pqsigfunc func);
+extern void pqsignal(int signo, pqsigfunc func);
/* port/quotes.c */
extern char *escape_single_quotes_ascii(const char *src);