public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in net-misc/openntpd/files: openntpd-20080406-dns-timeout.patch openntpd-20080406-signal.patch openntpd.logrotate-20080406-r5
@ 2013-12-10  9:31 Christoph Junghans (ottxor)
  0 siblings, 0 replies; only message in thread
From: Christoph Junghans (ottxor) @ 2013-12-10  9:31 UTC (permalink / raw
  To: gentoo-commits

ottxor      13/12/10 09:31:31

  Added:                openntpd-20080406-dns-timeout.patch
                        openntpd-20080406-signal.patch
  Removed:              openntpd.logrotate-20080406-r5
  Log:
  fixed signal on linux (bug #493084), fixed dns-timeout (bug #493358), make Paul maintainer
  
  (Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key C2000586)

Revision  Changes    Path
1.1                  net-misc/openntpd/files/openntpd-20080406-dns-timeout.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openntpd/files/openntpd-20080406-dns-timeout.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openntpd/files/openntpd-20080406-dns-timeout.patch?rev=1.1&content-type=text/plain

Index: openntpd-20080406-dns-timeout.patch
===================================================================
fix dns lookups timeout
https://bugs.gentoo.org/show_bug.cgi?id=493358

diff -u openntpd-20080406p-orig/ntpd.c openntpd-20080406p/ntpd.c
--- openntpd-20080406p-orig/ntpd.c	2013-12-04 20:12:02.562857933 -0800
+++ openntpd-20080406p/ntpd.c	2013-12-04 20:22:55.617577783 -0800
@@ -34,6 +34,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <time.h>
 #include <unistd.h>
 
 #include "ntpd.h"
@@ -95,6 +96,7 @@
 	int			 ch, nfds, timeout = INFTIM;
 	int			 pipe_chld[2];
 	extern char		*__progname;
+	time_t			start_time;
 
 	__progname = _compat_get_progname(argv[0]);
 
@@ -197,6 +199,8 @@
 		fatal(NULL);
 	imsg_init(ibuf, pipe_chld[0]);
 
+	start_time = getmonotime();
+
 	while (quit == 0) {
 		pfd[PFD_PIPE].fd = ibuf->fd;
 		pfd[PFD_PIPE].events = POLLIN;
@@ -209,11 +213,12 @@
 				quit = 1;
 			}
 
-		if (nfds == 0 && lconf.settime) {
+		if (lconf.settime &&
+		    (nfds == 0 || getmonotime() > start_time+SETTIME_TIMEOUT)) {
 			lconf.settime = 0;
 			timeout = INFTIM;
 			log_init(lconf.debug);
-			log_debug("no reply received in time, skipping initial "
+			log_warnx("no reply received in time, skipping initial "
 			    "time setting");
 			if (!lconf.debug) {
 				if (daemon(1, 0))



1.1                  net-misc/openntpd/files/openntpd-20080406-signal.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openntpd/files/openntpd-20080406-signal.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/net-misc/openntpd/files/openntpd-20080406-signal.patch?rev=1.1&content-type=text/plain

Index: openntpd-20080406-signal.patch
===================================================================
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]);





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-12-10  9:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-10  9:31 [gentoo-commits] gentoo-x86 commit in net-misc/openntpd/files: openntpd-20080406-dns-timeout.patch openntpd-20080406-signal.patch openntpd.logrotate-20080406-r5 Christoph Junghans (ottxor)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox