diff options
Diffstat (limited to 'contrib/ntp/libntp/machines.c')
-rw-r--r-- | contrib/ntp/libntp/machines.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/contrib/ntp/libntp/machines.c b/contrib/ntp/libntp/machines.c index d0db63c..9e318bf 100644 --- a/contrib/ntp/libntp/machines.c +++ b/contrib/ntp/libntp/machines.c @@ -18,7 +18,7 @@ #endif #ifdef SYS_WINNT -# include <conio.h> +int _getch(void); /* Declare the one function rather than include conio.h */ #else #ifdef SYS_VXWORKS @@ -445,7 +445,15 @@ ntp_set_tod( #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. + */ + adjtv.tv_sec = adjtv.tv_usec = 0; + adjtime(&adjtv, NULL); rc = SETTIMEOFDAY(tvp, tzp); #ifdef DEBUG if (debug) { |