"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "ntpdate/ntpdate.c" between
ntp-4.2.8p14.tar.gz and ntp-4.2.8p15.tar.gz

About: NTP is the the Official Reference Implementation of the Network Time Protocol (NTP) that synchronize the clocks of computers over a network.

ntpdate.c  (ntp-4.2.8p14):ntpdate.c  (ntp-4.2.8p15)
skipping to change at line 1967 skipping to change at line 1967
/* NT's _read does not operate on nonblocking sockets /* NT's _read does not operate on nonblocking sockets
* either recvfrom or ReadFile() has to be used here. * either recvfrom or ReadFile() has to be used here.
* ReadFile is used in [ntpd]ntp_intres() and ntpdc, * ReadFile is used in [ntpd]ntp_intres() and ntpdc,
* just to be different use recvfrom() here * just to be different use recvfrom() here
*/ */
recvfrom(fdc, buf, sizeof(buf), 0, (struct sockaddr *)0, NULL); recvfrom(fdc, buf, sizeof(buf), 0, (struct sockaddr *)0, NULL);
#endif /* SYS_WINNT */ #endif /* SYS_WINNT */
continue; continue;
} }
rb = get_free_recv_buffer(); rb = get_free_recv_buffer(TRUE);
fromlen = sizeof(rb->recv_srcadr); fromlen = sizeof(rb->recv_srcadr);
rb->recv_length = recvfrom(fdc, (char *)&rb->recv_pkt, rb->recv_length = recvfrom(fdc, (char *)&rb->recv_pkt,
sizeof(rb->recv_pkt), 0, sizeof(rb->recv_pkt), 0,
(struct sockaddr *)&rb->recv_srcadr, &fromlen); (struct sockaddr *)&rb->recv_srcadr, &fromlen);
if (rb->recv_length == -1) { if (rb->recv_length == -1) {
freerecvbuf(rb); freerecvbuf(rb);
continue; continue;
} }
skipping to change at line 1995 skipping to change at line 1995
} }
/* /*
* adj_systime - do a big long slew of the system time * adj_systime - do a big long slew of the system time
*/ */
static int static int
l_adj_systime( l_adj_systime(
l_fp *ts l_fp *ts
) )
{ {
struct timeval adjtv, oadjtv; struct timeval adjtv;
int isneg = 0; int isneg = 0;
l_fp offset; l_fp offset;
#ifndef STEP_SLEW #ifndef STEP_SLEW
l_fp overshoot; l_fp overshoot;
#endif #endif
/* /*
* Take the absolute value of the offset * Take the absolute value of the offset
*/ */
offset = *ts; offset = *ts;
skipping to change at line 2035 skipping to change at line 2035
if (isneg) { if (isneg) {
adjtv.tv_sec = -adjtv.tv_sec; adjtv.tv_sec = -adjtv.tv_sec;
adjtv.tv_usec = -adjtv.tv_usec; adjtv.tv_usec = -adjtv.tv_usec;
} }
if (!debug && (adjtv.tv_usec != 0)) { if (!debug && (adjtv.tv_usec != 0)) {
/* A time correction needs to be applied. */ /* A time correction needs to be applied. */
#if !defined SYS_WINNT && !defined SYS_CYGWIN32 #if !defined SYS_WINNT && !defined SYS_CYGWIN32
/* Slew the time on systems that support this. */ /* Slew the time on systems that support this. */
struct timeval oadjtv;
if (adjtime(&adjtv, &oadjtv) < 0) { if (adjtime(&adjtv, &oadjtv) < 0) {
msyslog(LOG_ERR, "Can't adjust the time of day: %m"); msyslog(LOG_ERR, "Can't adjust the time of day: %m");
exit(1); exit(1);
} }
#else /* SYS_WINNT or SYS_CYGWIN32 is defined */ #else /* SYS_WINNT or SYS_CYGWIN32 is defined */
/* /*
* The NT SetSystemTimeAdjustment() call achieves slewing by * The NT SetSystemTimeAdjustment() call achieves slewing by
* changing the clock frequency. This means that we cannot specif y * changing the clock frequency. This means that we cannot specif y
* it to slew the clock by a definite amount and then stop like * it to slew the clock by a definite amount and then stop like
* the Unix adjtime() routine. We can technically adjust the cloc k * the Unix adjtime() routine. We can technically adjust the cloc k
 End of changes. 3 change blocks. 
2 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)