From: Harlan Stenn Date: Sat, 22 Oct 2005 03:39:36 +0000 (-0400) Subject: [Bug 515] ntp_set_tod() displays stale errno X-Git-Tag: NTP_4_2_0B_RC1~37^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bd128da067f52ea25ef5153f475f9d68558e6524;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 9e318bf29..d259f8d24 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) {