summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/bin/initdb/initdb.c19
-rw-r--r--src/bin/pg_test_fsync/pg_test_fsync.c5
-rw-r--r--src/test/regress/pg_regress.c8
3 files changed, 13 insertions, 19 deletions
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 101c780012b..ea4b66b3bf5 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -2874,27 +2874,18 @@ setup_text_search(void)
void
setup_signals(void)
{
- /* some of these are not valid on Windows */
-#ifdef SIGHUP
- pqsignal(SIGHUP, trapsig);
-#endif
-#ifdef SIGINT
pqsignal(SIGINT, trapsig);
-#endif
-#ifdef SIGQUIT
- pqsignal(SIGQUIT, trapsig);
-#endif
-#ifdef SIGTERM
pqsignal(SIGTERM, trapsig);
-#endif
+
+ /* the following are not valid on Windows */
+#ifndef WIN32
+ pqsignal(SIGHUP, trapsig);
+ pqsignal(SIGQUIT, trapsig);
/* Ignore SIGPIPE when writing to backend, so we can clean up */
-#ifdef SIGPIPE
pqsignal(SIGPIPE, SIG_IGN);
-#endif
/* Prevent SIGSYS so we can probe for kernel calls that might not work */
-#ifdef SIGSYS
pqsignal(SIGSYS, SIG_IGN);
#endif
}
diff --git a/src/bin/pg_test_fsync/pg_test_fsync.c b/src/bin/pg_test_fsync/pg_test_fsync.c
index 5a2aabef26b..0060ea15902 100644
--- a/src/bin/pg_test_fsync/pg_test_fsync.c
+++ b/src/bin/pg_test_fsync/pg_test_fsync.c
@@ -112,11 +112,10 @@ main(int argc, char *argv[])
/* Prevent leaving behind the test file */
pqsignal(SIGINT, signal_cleanup);
pqsignal(SIGTERM, signal_cleanup);
+
+ /* the following are not valid on Windows */
#ifndef WIN32
pqsignal(SIGALRM, process_alarm);
-#endif
-#ifdef SIGHUP
- /* Not defined on win32 */
pqsignal(SIGHUP, signal_cleanup);
#endif
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index cbef6d48d31..61a234ae218 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -518,11 +518,15 @@ make_temp_sockdir(void)
* Remove the directory before dying to the usual signals. Omit SIGQUIT,
* preserving it as a quick, untidy exit.
*/
- pqsignal(SIGHUP, signal_remove_temp);
pqsignal(SIGINT, signal_remove_temp);
- pqsignal(SIGPIPE, signal_remove_temp);
pqsignal(SIGTERM, signal_remove_temp);
+ /* the following are not valid on Windows */
+#ifndef WIN32
+ pqsignal(SIGHUP, signal_remove_temp);
+ pqsignal(SIGPIPE, signal_remove_temp);
+#endif
+
return temp_sockdir;
}