[ntp:bk-ntp-dev-send] BitKeeper diffs

stenn at whimsy.udel.edu stenn at whimsy.udel.edu
Sun Jul 7 05:43:04 UTC 2013


#### ChangeSet ####
2013-07-07 01:42:37-04:00, stenn at deacon.udel.edu
  CID 1042586: Check the return value of clock_gettime() in worker_sleep()

==== ChangeLog ====
2013-07-07 01:03:19-04:00, stenn at deacon.udel.edu +1 -0
  CID 1042586: Check the return value of clock_gettime() in worker_sleep()

--- 1.1302/ChangeLog	2013-07-06 07:30:47 -04:00
+++ 1.1303/ChangeLog	2013-07-07 01:03:19 -04:00
@@ -1,3 +1,4 @@
+* CID 1042586: Check the return value of clock_gettime() in worker_sleep().
 (4.2.7p370) 2013/07/06 Released by Harlan Stenn <stenn at ntp.org>
 * Remove \n's from syslog output strings.
 (4.2.7p369) 2013/07/05 Released by Harlan Stenn <stenn at ntp.org>

==== libntp/work_thread.c ====
2013-07-07 01:03:19-04:00, stenn at deacon.udel.edu +9 -3
  CID 1042586: Check the return value of clock_gettime() in worker_sleep()

--- 1.13/libntp/work_thread.c	2013-07-06 01:36:10 -04:00
+++ 1.14/libntp/work_thread.c	2013-07-07 01:03:19 -04:00
@@ -87,9 +87,15 @@ worker_sleep(
 	int		rc;
 
 # ifdef HAVE_CLOCK_GETTIME
-	clock_gettime(CLOCK_REALTIME, &until);
+	if (0 != clock_gettime(CLOCK_REALTIME, &until)) {
+		msyslog(LOG_ERR, "worker_sleep: clock_gettime() failed: %m");
+		return -1;
+	}
 # else
-	getclock(TIMEOFDAY, &until);
+	if (0 != getclock(TIMEOFDAY, &until)) {
+		msyslog(LOG_ERR, "worker_sleep: getclock() failed: %m");
+		return -1;
+	}
 # endif
 	until.tv_sec += seconds;
 	do {
@@ -99,7 +105,7 @@ worker_sleep(
 		return -1;
 	if (-1 == rc && ETIMEDOUT == errno)
 		return 0;
-	msyslog(LOG_ERR, "worker_sleep sem_timedwait %m");
+	msyslog(LOG_ERR, "worker_sleep: sem_timedwait: %m");
 	return -1;
 }
 


More information about the bk-ntp-dev-send mailing list