From: Harlan Stenn Date: Sat, 22 Oct 2005 03:39:36 +0000 (-0400) Subject: [Bug 515] ntp_set_tod() displays stale errno X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf3bd93c1fa0eb8491fd985d359c177fc18ff383;p=thirdparty%2Fntp.git [Bug 515] ntp_set_tod() displays stale errno bk: 4359b478HEkoyNJle-1IaFEBvQoUAA --- diff --git a/libntp/machines.c b/libntp/machines.c index 9e318bf290..d259f8d24d 100644 --- a/libntp/machines.c +++ b/libntp/machines.c @@ -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) {