Description: Fix DNS timeout lookup 
Author: Paul B. Henson <henson@acm.org> 
Origin: https://bugs.gentoo.org/show_bug.cgi?id=493358

Index: git/ntpd.c
===================================================================
--- git.orig/ntpd.c	2013-12-23 18:23:22.000000000 -0300
+++ git/ntpd.c	2013-12-23 18:23:22.000000000 -0300
@@ -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]);

@@ -194,6 +196,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;
@@ -206,11 +210,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))
