[Git][NTPsec/ntpsec][master] 2 commits: struct timeval elimination.

Eric S. Raymond gitlab at mg.gitlab.com
Sat Oct 1 14:48:23 UTC 2016


Eric S. Raymond pushed to branch master at NTPsec / ntpsec


Commits:
4d8d6c87 by Eric S. Raymond at 2016-10-01T10:43:35-04:00
struct timeval elimination.

- - - - -
758b3b53 by Eric S. Raymond at 2016-10-01T10:48:11-04:00
struct timeval elimnination (from GPSD refclock driver).

- - - - -


2 changed files:

- ntpd/refclock_gpsd.c
- ntpd/refclock_oncore.c


Changes:

=====================================
ntpd/refclock_gpsd.c
=====================================
--- a/ntpd/refclock_gpsd.c
+++ b/ntpd/refclock_gpsd.c
@@ -1950,13 +1950,13 @@ gpsd_test_socket(
 		    up->logname, up->fdt));
 
 	{
-		struct timeval tout;
+		struct timespec tout;
 		fd_set         wset;
 
 		memset(&tout, 0, sizeof(tout));
 		FD_ZERO(&wset);
 		FD_SET(up->fdt, &wset);
-		rc = select(up->fdt+1, NULL, &wset, NULL, &tout);
+		rc = pselect(up->fdt+1, NULL, &wset, NULL, &tout, NULL);
 		if (0 == rc || !(FD_ISSET(up->fdt, &wset)))
 			return;
 	}


=====================================
ntpd/refclock_oncore.c
=====================================
--- a/ntpd/refclock_oncore.c
+++ b/ntpd/refclock_oncore.c
@@ -1894,15 +1894,12 @@ oncore_msg_any(
 	char *q;
 	char *qlim;
 	struct timespec ts;
-	struct timeval tv;
 	char	Msg[120], Msg2[10];
 
 	if (debug > 3) {
 		(void) clock_gettime(CLOCK_REALTIME, &ts);
-		tv.tv_sec = ts.tv_sec;
-		tv.tv_usec = ts.tv_nsec / 1000;
-		oncore_log(instance, LOG_DEBUG, "%ld.%06ld",
-			   (long)tv.tv_sec, (long)tv.tv_usec);
+		oncore_log(instance, LOG_DEBUG, "%ld.%09ld",
+			   (long)tv.tv_sec, (long)tv.tv_nsec);
 
 		if (!*fmt) {
 			snprintf(Msg, sizeof(Msg), ">>@@%c%c ", buf[2],



View it on GitLab: https://gitlab.com/NTPsec/ntpsec/compare/85da7698b261f14d9212de0ac83f1e6c042f9834...758b3b530b3890a6ac0edd4e8612d5467a2233c9
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ntpsec.org/pipermail/vc/attachments/20161001/18162fa0/attachment.html>


More information about the vc mailing list