From: Harlan Stenn Date: Sun, 2 Dec 2001 17:23:39 +0000 (-0500) Subject: automerge + conflict resolution. X-Git-Tag: NTP_4_1_73~226 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=461663d364855369e4d9ef424c89d121ef7b5340;p=thirdparty%2Fntp.git automerge + conflict resolution. bk: 3c0a639bw54oAgp0OTGgQjchrsX8VQ --- 461663d364855369e4d9ef424c89d121ef7b5340 diff --cc libntp/machines.c index b2001fe12b,4d63f3cf9d..05ce6eb7ac --- a/libntp/machines.c +++ b/libntp/machines.c @@@ -417,28 -417,36 +417,37 @@@ ntp_set_tod void *tzp ) { - int rc; + int rc = -1; - struct timeval adjtv; + + #ifdef DEBUG + if (debug) + printf("In ntp_set_tod\n"); + #endif #ifdef HAVE_CLOCK_SETTIME - { + if (rc) { struct timespec ts; + set_tod_using = "clock_settime"; /* Convert timeval to timespec */ ts.tv_sec = tvp->tv_sec; ts.tv_nsec = 1000 * tvp->tv_usec; + errno = 0; rc = clock_settime(CLOCK_REALTIME, &ts); - if (!rc) - { - set_tod_using = "clock_settime"; - return rc; - } } + #ifdef DEBUG + if (debug) { + printf("ntp_set_tod: %s: %d: %s\n", + set_tod_using, rc, strerror(errno)); + } + #endif #endif /* HAVE_CLOCK_SETTIME */ #ifdef HAVE_SETTIMEOFDAY - { + if (rc) { + struct timeval adjtv; + + set_tod_using = "settimeofday"; /* * Some broken systems don't reset adjtime() when the * clock is stepped.