[Git][NTPsec/ntpsec][master] Remove some indirection macros SIGDIE[1234].
Eric S. Raymond
gitlab at mg.gitlab.com
Mon Aug 29 11:39:00 UTC 2016
Eric S. Raymond pushed to branch master at NTPsec / ntpsec
Commits:
4dfa86c9 by Eric S. Raymond at 2016-08-29T07:38:01-04:00
Remove some indirection macros SIGDIE[1234].
These port checks are better done explicitly.
- - - - -
5 changed files:
- devel/TODO
- devel/ifdex-ignores
- include/ntpd.h
- libntp/work_thread.c
- ntpd/ntpd.c
Changes:
=====================================
devel/TODO
=====================================
--- a/devel/TODO
+++ b/devel/TODO
@@ -205,7 +205,7 @@ __________
Requires Perl and Python skills.
* In tests/perl are, apparently, unit tests for old Perl code.
-0 Some attempt should be made to salvage these. Requires Perl and
+ Some attempt should be made to salvage these. Requires Perl and
Python skills.
// end
=====================================
devel/ifdex-ignores
=====================================
--- a/devel/ifdex-ignores
+++ b/devel/ifdex-ignores
@@ -134,10 +134,6 @@ ONCORE_VERBOSE_.* # Debugging symbols internal to the OnCore refclock
PI # Math constant used by the sim code
RUN_TEST # Internal to Unity
SETSOCKOPT_ARG_CAST # Can probably go away when the Windows port is cleaned up.
-SIGDIE1
-SIGDIE2
-SIGDIE3
-SIGDIE4
THREAD_MINSTACKSIZE
UINTPTR_MAX # Unity and Windowa
UINTPTR_MAX0 # Unity
=====================================
include/ntpd.h
=====================================
--- a/include/ntpd.h
+++ b/include/ntpd.h
@@ -253,15 +253,6 @@ extern char * fstostr(time_t); /* NTP timescale seconds */
*/
#define MOREDEBUGSIG SIGUSR1
#define LESSDEBUGSIG SIGUSR2
-/*
- * Signals which terminate us gracefully.
- */
-#ifndef SYS_WINNT
-# define SIGDIE1 SIGINT
-# define SIGDIE2 SIGQUIT
-# define SIGDIE3 SIGTERM
-#endif /* SYS_WINNT */
-
/*
* Last half: ntpd variables
=====================================
libntp/work_thread.c
=====================================
--- a/libntp/work_thread.c
+++ b/libntp/work_thread.c
@@ -508,17 +508,14 @@ block_thread_signals(
sigaddset(&block, SIGALRM);
sigaddset(&block, MOREDEBUGSIG);
sigaddset(&block, LESSDEBUGSIG);
-# ifdef SIGDIE1
- sigaddset(&block, SIGDIE1);
+# ifdef SIGINT
+ sigaddset(&block, SIGINT);
+# endif
+# ifdef SIGQUIT
+ sigaddset(&block, SIGQUIT);
# endif
-# ifdef SIGDIE2
- sigaddset(&block, SIGDIE2);
-# endif
-# ifdef SIGDIE3
- sigaddset(&block, SIGDIE3);
-# endif
-# ifdef SIGDIE4
- sigaddset(&block, SIGDIE4);
+# ifdef SIGTERM
+ sigaddset(&block, SIGTERM);
# endif
# ifdef SIGBUS
sigaddset(&block, SIGBUS);
=====================================
ntpd/ntpd.c
=====================================
--- a/ntpd/ntpd.c
+++ b/ntpd/ntpd.c
@@ -37,7 +37,7 @@ extern bool sandbox(const bool droproot,
const char *chrootdir,
bool want_dynamic_interface_tracking);
-#if defined(SIGDIE1)
+#if defined(SIGINT) || defined(SIGQUIT) || defined(SIGTERM)
static volatile bool signalled = false;
static volatile int signo = 0;
/* In an ideal world, 'finish_safe()' would declared as noreturn... */
@@ -704,10 +704,14 @@ ntpdmain(
/*
* Set up signals we pay attention to locally.
*/
-# ifdef SIGDIE1
- signal_no_reset(SIGDIE1, finish);
- signal_no_reset(SIGDIE2, finish);
- signal_no_reset(SIGDIE3, finish);
+# ifdef SIGINT
+ signal_no_reset(SIGINT, finish);
+# endif
+# ifdef SIGQUIT
+ signal_no_reset(SIGQUIT, finish);
+# endif
+# ifdef SIGTERM
+ signal_no_reset(SIGTERM, finish);
# endif
# ifdef SIGHUP
signal_no_reset(SIGHUP, catchHUP);
@@ -952,7 +956,7 @@ static void mainloop(void)
# ifdef HAVE_IO_COMPLETION_PORT
for (;;) {
-#if defined(SIGDIE1)
+#if defined(SIGINT) || defined(SIGQUIT) || defined(SIGTERM)
if (signalled)
finish_safe(signo);
#endif
@@ -962,7 +966,7 @@ static void mainloop(void)
was_alarmed = false;
for (;;) {
-#if defined(SIGDIE1)
+#if defined(SIGINT) || defined(SIGQUIT) || defined(SIGTERM)
if (signalled)
finish_safe(signo);
#endif
@@ -1092,7 +1096,7 @@ static void mainloop(void)
}
-#if defined(SIGDIE1)
+#if defined(SIGINT) || defined(SIGQUIT) || defined(SIGTERM)
/*
* finish - exit gracefully
*/
@@ -1135,7 +1139,7 @@ static void catchHUP(int sig)
sawHUP = true;
}
-#endif /* SIGDIE1 */
+#endif /* defined(SIGINT) || defined(SIGQUIT) || defined(SIGTERM) */
/*
View it on GitLab: https://gitlab.com/NTPsec/ntpsec/commit/4dfa86c956a9cea4f31bd0d1063d262c437989c1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20160829/bf83707a/attachment.html>
More information about the vc
mailing list