]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
[Bug 515] ntp_set_tod() displays stale errno
authorHarlan Stenn <stenn@ntp.org>
Sat, 22 Oct 2005 03:39:36 +0000 (23:39 -0400)
committerHarlan Stenn <stenn@ntp.org>
Sat, 22 Oct 2005 03:39:36 +0000 (23:39 -0400)
bk: 4359b478HEkoyNJle-1IaFEBvQoUAA

libntp/machines.c

index 9e318bf29088a32cbd770da2cd27b5efbe57214b..d259f8d24d4350f98b156ff9a34a80da14be79a4 100644 (file)
@@ -454,6 +454,7 @@ ntp_set_tod(
                 */
                adjtv.tv_sec = adjtv.tv_usec = 0;
                adjtime(&adjtv, NULL);
+               errno = 0;
                rc = SETTIMEOFDAY(tvp, tzp);
 #ifdef DEBUG
                if (debug) {
@@ -468,6 +469,7 @@ ntp_set_tod(
                long tp = tvp->tv_sec;
 
                set_tod_using = "stime";
+               errno = 0;
                rc = stime(&tp); /* lie as bad as SysVR4 */
 #ifdef DEBUG
                if (debug) {