gentoo-overlay/net-misc/openntpd/files/openntpd-20080406-signal.patch

58 lines
1.5 KiB
Diff
Raw Normal View History

allow SIGUSR1 as stand-in for SIGINFO (on e.g linux)
https://bugs.gentoo.org/show_bug.cgi?id=493084
diff -u openntpd-20080406p-orig/ntp.c openntpd-20080406p/ntp.c
--- openntpd-20080406p-orig/ntp.c 2013-12-04 15:11:04.417274938 -0800
+++ openntpd-20080406p/ntp.c 2013-12-04 15:12:21.066006404 -0800
@@ -67,9 +67,11 @@
break;
#ifdef HAVE_SIGINFO
case SIGINFO:
- ntp_report = 1;
- break;
+#else
+ case SIGUSR1:
#endif
+ ntp_report = 1;
+ break;
}
}
@@ -158,6 +160,8 @@
signal(SIGINT, ntp_sighdlr);
#ifdef USE_SIGINFO
signal(SIGINFO, ntp_sighdlr);
+#else
+ signal(SIGUSR1, ntp_sighdlr);
#endif
signal(SIGPIPE, SIG_IGN);
signal(SIGHUP, SIG_IGN);
diff -u openntpd-20080406p-orig/ntpd.8 openntpd-20080406p/ntpd.8
--- openntpd-20080406p-orig/ntpd.8 2013-12-04 15:11:04.416274915 -0800
+++ openntpd-20080406p/ntpd.8 2013-12-04 15:12:21.066006404 -0800
@@ -104,7 +104,11 @@
.Nm
receives a
.Dv SIGINFO
-signal, it will write its peer and sensor status to syslog.
+signal (or a
+.Dv SIGUSR1
+signal on systems without
+.Dv SIGINFO
+), it will write its peer and sensor status to syslog.
.Sh FILES
.Bl -tag -width "/var/lib/openntpd/ntpd.driftXXX" -compact
.It Pa /etc/ntpd.conf
diff -u openntpd-20080406p-orig/ntpd.c openntpd-20080406p/ntpd.c
--- openntpd-20080406p-orig/ntpd.c 2013-12-04 15:11:04.416274915 -0800
+++ openntpd-20080406p/ntpd.c 2013-12-04 15:14:21.586728922 -0800
@@ -187,6 +187,9 @@
signal(SIGTERM, sighdlr);
signal(SIGINT, sighdlr);
signal(SIGHUP, sighdlr);
+ #ifndef HAVE_SIGINFO
+ signal(SIGUSR1, SIG_IGN);
+ #endif
close(pipe_chld[1]);