From: Harlan Stenn Date: Tue, 22 Jun 1999 07:19:32 +0000 (-0000) Subject: Many files: X-Git-Tag: NTP_4_0_94~34 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e0157ebda45938f5bfb967ac41f522789941ac66;p=thirdparty%2Fntp.git Many files: * include/ntp_machine.h: Removed superfluous yy/mm/dd comments. * include/ntpd.h: Likewise. * libntp/authencrypt.c: Likewise. * libntp/a_md5encrypt.c: Likewise. * libntp/caljulian.c: Likewise. * libntp/ymd2yd.c: Likewise. * libntp/syssignal.c: Likewise. * libntp/ymd2yd.c: Likewise. * ntpd/ntp_control.c: Likewise. * ntpd/ntp_io.c: Likewise. * ntpd/ntp_timer.c: Likewise. * ntpdate/ntpdate.c: Likewise. * ntpq/ntpq_ops.c: Likewise. * ntpd/ntp_peer.c (findpeer): Wrap debug output in DEBUG/debug. From: Rainer Orth * dot.emacs: Removed wrong indentation of substatements. Wrap in c-style. From: Rainer Orth bk: 376f39045S3MqheL4yFUBgoqGTcVUg --- diff --git a/ChangeLog b/ChangeLog index 5073f02ddf..d64b6cc559 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,25 @@ 1999-06-22 Harlan Stenn + * include/ntp_machine.h: Removed superfluous yy/mm/dd comments. + * include/ntpd.h: Likewise. + * libntp/authencrypt.c: Likewise. + * libntp/a_md5encrypt.c: Likewise. + * libntp/caljulian.c: Likewise. + * libntp/ymd2yd.c: Likewise. + * libntp/syssignal.c: Likewise. + * libntp/ymd2yd.c: Likewise. + * ntpd/ntp_control.c: Likewise. + * ntpd/ntp_io.c: Likewise. + * ntpd/ntp_timer.c: Likewise. + * ntpdate/ntpdate.c: Likewise. + * ntpq/ntpq_ops.c: Likewise. + * ntpd/ntp_peer.c (findpeer): Wrap debug output in DEBUG/debug. + From: Rainer Orth + + * dot.emacs: Removed wrong indentation of substatements. + Wrap in c-style. + From: Rainer Orth + * ntpd/refclock_palisade.c: Patches from Marc Brett * ntpd/refclock_palisade.h: Ditto. * util/hist.c: Ditto. diff --git a/dot.emacs b/dot.emacs index 3a6b14a713..e4f507f628 100644 --- a/dot.emacs +++ b/dot.emacs @@ -1,9 +1,18 @@ ;; This is how Dave Mills likes to see the code formatted. -(setq c-basic-offset 8) -(c-set-offset 'arglist-intro +) -(c-set-offset 'case-label *) -(c-set-offset 'statement-case-intro *) -(c-set-offset 'statement-cont *) -(c-set-offset 'substatement *) -(c-set-offset 'substatement-open 0) + +(defconst ntp-c-style + '((c-basic-offset . 8) + (c-offsets-alist . ((arglist-intro +) + (case-label *) + (statement-case-intro *) + (statement-cont *) + (substatement-open 0)))) + "Dave L. Mills; programming style for use with ntp") + +(defun ntp-c-mode-common-hook () + ;; add ntp c style + (c-add-style "ntp" ntp-c-style nil)) + +(add-hook 'c-mode-common-hook 'ntp-c-mode-common-hook) + ;; 1997112600 diff --git a/include/ntp_machine.h b/include/ntp_machine.h index 086b84db12..5d3275657a 100644 --- a/include/ntp_machine.h +++ b/include/ntp_machine.h @@ -232,15 +232,15 @@ typedef unsigned long u_long; */ #if defined(SYS_WINNT) #if !defined(HAVE_CONFIG_H) -# define MCAST /* Enable Multicast Support */ /* 98/06/01 */ -# undef OPEN_BCAST_SOCKET /* for ntp_io.c */ /* 98/06/01 *//* 98/06/03 */ -# undef UDP_WILDCARD_DELIVERY /* for ntp_io.c */ /* 98/06/01 */ +# define MCAST /* Enable Multicast Support */ +# undef OPEN_BCAST_SOCKET /* for ntp_io.c */ +# undef UDP_WILDCARD_DELIVERY /* for ntp_io.c */ # define REFCLOCK /* from ntpd.mak */ # define CLOCK_LOCAL /* from ntpd.mak */ -# define CLOCK_SHM /* from ntpd.mak */ /* 98/06/01 */ -# define CLOCK_PALISADE /* from ntpd.mak */ /* 98/06/26 */ -# undef DES /* from libntp.mak */ /* 98/05/28 */ -# undef MD5 /* from libntp.mak */ /* 98/05/28 */ +# define CLOCK_SHM /* from ntpd.mak */ +# define CLOCK_PALISADE /* from ntpd.mak */ +# undef DES /* from libntp.mak */ +# undef MD5 /* from libntp.mak */ # define NTP_LITTLE_ENDIAN /* from libntp.mak */ # define SYSLOG_FILE /* from libntp.mak */ # define HAVE_PROTOTYPES /* from ntpq.mak */ @@ -282,7 +282,7 @@ typedef unsigned long u_long; # include # undef interface typedef char *caddr_t; -void PASCAL alarming P((UINT,UINT,DWORD,DWORD,DWORD)); /* 98/06/03 */ +void PASCAL alarming P((UINT,UINT,DWORD,DWORD,DWORD)); #endif /* SYS_WINNT */ int ntp_set_tod P((struct timeval *tvp, void *tzp)); diff --git a/include/ntpd.h b/include/ntpd.h index 71a5bd0e0e..9de1531fb2 100644 --- a/include/ntpd.h +++ b/include/ntpd.h @@ -20,8 +20,8 @@ void worker_thread (void *); #define TARGET_RESOLUTION 1 /* Try for 1-millisecond accuracy. * used in ntp_timer.c */ -extern DWORD units_per_tick; /* 98/05/28 *//* 98/05/29 */ -extern long adj_precision; /* 98/05/28 *//* 98/05/29 */ +extern DWORD units_per_tick; +extern long adj_precision; #else #define closesocket close #endif /* SYS_WINNT */ diff --git a/libntp/a_md5encrypt.c b/libntp/a_md5encrypt.c index 18343f7563..5c38035520 100644 --- a/libntp/a_md5encrypt.c +++ b/libntp/a_md5encrypt.c @@ -7,9 +7,9 @@ * the US and foreign countries. Further information is available at * www.rsa.com. */ - /* 98/05/28 */ -#include "ntp_machine.h" /* 98/05/28 */ - /* 98/05/28 */ + +#include "ntp_machine.h" + #ifdef HAVE_CONFIG_H #include #endif diff --git a/libntp/authencrypt.c b/libntp/authencrypt.c index cca5f9e666..f0f30232ca 100644 --- a/libntp/authencrypt.c +++ b/libntp/authencrypt.c @@ -7,9 +7,9 @@ * included in the rsaref2.0 package available from RSA in the US and * foreign countries. Further information is available at www.rsa.com. */ - /* 98/05/28 */ -#include "ntp_machine.h" /* 98/05/28 */ - /* 98/05/28 */ + +#include "ntp_machine.h" + #ifdef HAVE_CONFIG_H #include #endif diff --git a/libntp/caljulian.c b/libntp/caljulian.c index e36f978cf4..948bb1c57d 100644 --- a/libntp/caljulian.c +++ b/libntp/caljulian.c @@ -51,10 +51,10 @@ caljulian( * Do the easy stuff first: take care of hh:mm:ss, ignoring leap * seconds */ - jt->second = (u_char)(ntptime % SECSPERMIN); /* 98/06/04 */ + jt->second = (u_char)(ntptime % SECSPERMIN); minutes = ntptime / SECSPERMIN; - jt->minute = (u_char)(minutes % MINSPERHR); /* 98/06/04 */ - jt->hour = (u_char)((minutes / MINSPERHR) % HRSPERDAY); /* 98/06/04 */ + jt->minute = (u_char)(minutes % MINSPERHR); + jt->hour = (u_char)((minutes / MINSPERHR) % HRSPERDAY); /* * Find the day past 1900/01/01 00:00 UTC @@ -72,8 +72,8 @@ caljulian( /* * Calculate the year and year-of-day */ - jt->yearday = (u_short)(1 + d4%DAYSPERYEAR); /* 98/06/04 */ - jt->year = (u_short)(400*n400 + 100*n100 + n4*4 + n1); /* 98/06/04 */ + jt->yearday = (u_short)(1 + d4%DAYSPERYEAR); + jt->year = (u_short)(400*n400 + 100*n100 + n4*4 + n1); if (n100 == 4 || n1 == 4) { diff --git a/libntp/syssignal.c b/libntp/syssignal.c index 34f39fdd18..612d1203bb 100644 --- a/libntp/syssignal.c +++ b/libntp/syssignal.c @@ -103,13 +103,13 @@ signal_no_reset( RETSIGTYPE (*func) (int) ) { -#ifdef SIG_ERR /* 98/06/04 */ - if (SIG_ERR == signal(sig, func)) { /* 98/06/04 */ -#else /* 98/06/04 */ - int n; /* 98/06/04 */ - n = signal(sig, func); /* 98/06/04 */ - if (n == -1) { /* 98/06/04 */ -#endif /* 98/06/04 */ +#ifdef SIG_ERR + if (SIG_ERR == signal(sig, func)) { +#else + int n; + n = signal(sig, func); + if (n == -1) { +#endif perror("signal"); exit(1); } diff --git a/libntp/ymd2yd.c b/libntp/ymd2yd.c index 78773ffc26..796ce40948 100644 --- a/libntp/ymd2yd.c +++ b/libntp/ymd2yd.c @@ -25,10 +25,10 @@ ymd2yd( if (m < 1 || m > 12 || d < 1) return (-1); - if (((y%4 == 0) && (y%100 != 0)) || (y%400 == 0)) /* 98/06/04 */ - t = day2tab; /* leap year */ /* 98/06/04 */ + if (((y%4 == 0) && (y%100 != 0)) || (y%400 == 0)) + t = day2tab; /* leap year */ else - t = day1tab; /* not a leap year */ /* 98/06/04 */ + t = day1tab; /* not a leap year */ if (d > t[m - 1]) return (-1); for (i = 0; i < m - 1; i++) diff --git a/ntpd/ntp_control.c b/ntpd/ntp_control.c index 607d7033de..5a23f04138 100644 --- a/ntpd/ntp_control.c +++ b/ntpd/ntp_control.c @@ -1148,9 +1148,9 @@ ctl_putsys( ) { l_fp tmp; -#ifdef HAVE_UNAME /* 98/06/04 */ +#ifdef HAVE_UNAME char str[50]; -#endif /* 98/06/04 */ +#endif switch (varid) { case CS_LEAP: diff --git a/ntpd/ntp_io.c b/ntpd/ntp_io.c index f0d61cb478..f50573d2c9 100644 --- a/ntpd/ntp_io.c +++ b/ntpd/ntp_io.c @@ -32,8 +32,8 @@ #if _BSDI_VERSION >= 199510 # include #endif -/* 98/06/01 */ -#include "ntp_machine.h" /* 98/06/01 */ + +#include "ntp_machine.h" #include "ntpd.h" #include "ntp_select.h" #include "ntp_io.h" @@ -491,11 +491,10 @@ create_sockets( (ifr->ifr_addr.sa_family != AF_INET) # endif /* VMS+UCX */ continue; - /* 98/06/02 */ ifreq = *ifr; - inter_list[i].flags = 0; /* 98/06/02 */ + inter_list[i].flags = 0; /* is it broadcast capable? */ -# ifndef SYS_WINNT /* 98/06/03 */ +# ifndef SYS_WINNT # ifdef STREAMS_TLI ioc.ic_cmd = SIOCGIFFLAGS; ioc.ic_timout = 0; @@ -640,7 +639,6 @@ create_sockets( inter_list[i].mask.sin_addr.s_addr = inet_addr(ifreq.ifr_mask); # endif /* not SYS_WINNT */ - /* 98/06/03 */ /* * look for an already existing source interface address. If * the machine has multiple point to point interfaces, then @@ -659,8 +657,7 @@ create_sockets( } closesocket(vs); #endif /* _BSDI_VERSION >= 199510 */ - /* 98/06/03 */ - /* 98/06/03 */ + ninterfaces = i; maxactivefd = 0; FD_ZERO(&activefds); @@ -757,7 +754,7 @@ io_setbclient(void) inter_list[i].bcast.sin_addr.s_addr = htonl(INADDR_ANY); #endif #ifdef OPEN_BCAST_SOCKET /* Was: !SYS_DOMAINOS && !SYS_LINUX */ - inter_list[i].bfd = open_socket(&inter_list[i].bcast, INT_BROADCAST, 1); /* 98/06/01 */ + inter_list[i].bfd = open_socket(&inter_list[i].bcast, INT_BROADCAST, 1); inter_list[i].flags |= INT_BCASTOPEN; #endif } @@ -1160,7 +1157,7 @@ findbcastinter( struct sockaddr_in *addr ) { -#if defined(SIOCGIFCONF) || defined(SYS_WINNT) /* 98/06/03 */ +#if defined(SIOCGIFCONF) || defined(SYS_WINNT) register int i; register u_int32 netnum; @@ -1315,7 +1312,7 @@ sendpkt( inter = any_interface; #ifdef DEBUG if (debug > 1) - printf("%ssendpkt(fd=%d dst=%s, src=%s, ttl=%d, len=%d)\n", /* 98/06/03 */ + printf("%ssendpkt(fd=%d dst=%s, src=%s, ttl=%d, len=%d)\n", (ttl >= 0) ? "\tMCAST\t*****" : "", inter->fd, ntoa(dest), ntoa(&inter->sin), ttl, len); @@ -1585,7 +1582,7 @@ input_handler( * on the wild card socket, just dump the * packet. */ - if ( /* 98/06/02 */ + if ( #ifdef UDP_WILDCARD_DELIVERY /* * these guys manage to put properly addressed @@ -1599,7 +1596,7 @@ input_handler( { char buf[RX_BUFF_SIZE]; struct sockaddr from; - /* 98/06/02 */ + fromlen = sizeof from; (void) recvfrom(fd, buf, sizeof(buf), 0, &from, &fromlen); #ifdef DEBUG @@ -2426,11 +2423,11 @@ get_winnt_interfaces( DWORD sizeofsubnetmasks = 10000; char bindservicenames[1000]; DWORD sizeofbindnames = 1000; - DWORD enableDhcp; /* 98/06/01 */ - DWORD sizeofenable = sizeof(DWORD); /* 98/06/01 */ - char *ipkeyname; /* 98/06/01 */ - char *maskkeyname; /* 98/06/01 */ - long ip, broad; /* 98/06/02 */ + DWORD enableDhcp; + DWORD sizeofenable = sizeof(DWORD); + char *ipkeyname; + char *maskkeyname; + long ip, broad; char oneIpAddress[16]; char oneSubNetMask[16]; @@ -2474,7 +2471,7 @@ get_winnt_interfaces( onenetcard = bindservicenames; while(1) { - onenetcard = onenetcard + 8; /* skip /Device/ prefix on the service name */ /* 98/06/01 */ + onenetcard = onenetcard + 8; /* skip /Device/ prefix on the service name */ if ((onenetcard < (bindservicenames + sizeofbindnames)) && (sscanf(onenetcard,"%s",servicename) != EOF)) { @@ -2521,55 +2518,55 @@ get_winnt_interfaces( } else { /* ok it is a network card */ - /* check for DHCP */ /* 98/06/01 */ - sizeofenable = sizeof(DWORD); /* 98/06/01 */ - bSuccess = /* 98/06/01 */ - RegQueryValueEx(hksub, /* subkey handle */ /* 98/06/01 */ - "EnableDHCP", /* value name */ /* 98/06/01 */ - NULL, /* must be zero */ /* 98/06/01 */ - NULL, /* value type not required */ /* 98/06/01 */ - (LPBYTE)&enableDhcp, /* address of value data */ /* 98/06/01 */ - &sizeofenable); /* length of value data */ /* 98/06/01 */ - if(bSuccess != ERROR_SUCCESS) /* 98/06/01 */ - { /* 98/06/01 */ - msyslog(LOG_ERR, "Error in RegQueryValueEx fetching EnableDHCP parameter: %m"); /* 98/06/01 */ - RegCloseKey(hksub); /* 98/06/01 */ - return -1; /* 98/06/01 */ - } /* 98/06/01 */ - /* 98/06/01 */ - if (enableDhcp) { /* 98/06/01 */ - ipkeyname = "DhcpIpAddress"; /* 98/06/01 */ - maskkeyname = "DhcpSubNetMask"; /* 98/06/01 */ - } /* 98/06/01 */ - else { /* 98/06/01 */ - ipkeyname = "IpAddress"; /* 98/06/01 */ - maskkeyname = "SubNetMask"; /* 98/06/01 */ - } /* 98/06/01 */ - /* ok now get the ipaddress */ /* 98/06/01 */ + /* check for DHCP */ + sizeofenable = sizeof(DWORD); + bSuccess = + RegQueryValueEx(hksub, /* subkey handle */ + "EnableDHCP", /* value name */ + NULL, /* must be zero */ + NULL, /* value type not required */ + (LPBYTE)&enableDhcp, /* address of value data */ + &sizeofenable); /* length of value data */ + if(bSuccess != ERROR_SUCCESS) + { + msyslog(LOG_ERR, "Error in RegQueryValueEx fetching EnableDHCP parameter: %m"); + RegCloseKey(hksub); + return -1; + } + + if (enableDhcp) { + ipkeyname = "DhcpIpAddress"; + maskkeyname = "DhcpSubNetMask"; + } + else { + ipkeyname = "IpAddress"; + maskkeyname = "SubNetMask"; + } + /* ok now get the ipaddress */ sizeofipaddresses = 10000; bSuccess = - RegQueryValueEx(hksub, /* subkey handle */ /* 98/06/01 */ - ipkeyname, /* value name */ /* 98/06/01 */ - NULL, /* must be zero */ /* 98/06/01 */ - NULL, /* value type not required */ /* 98/06/01 */ - (LPBYTE)&IpAddresses, /* address of value data */ /* 98/06/01 */ - &sizeofipaddresses); /* length of value data */ /* 98/06/01 */ + RegQueryValueEx(hksub, /* subkey handle */ + ipkeyname, /* value name */ + NULL, /* must be zero */ + NULL, /* value type not required */ + (LPBYTE)&IpAddresses, /* address of value data */ + &sizeofipaddresses); /* length of value data */ if(bSuccess != ERROR_SUCCESS) { msyslog(LOG_ERR, "Error in RegQueryValueEx fetching IpAddress parameter: %m"); RegCloseKey(hksub); return -1; } - /* 98/06/01 */ - /* ok now get the subnetmask */ /* 98/06/01 */ + + /* ok now get the subnetmask */ sizeofsubnetmasks = 10000; bSuccess = - RegQueryValueEx(hksub, /* subkey handle */ /* 98/06/01 */ - maskkeyname, /* value name */ /* 98/06/01 */ - NULL, /* must be zero */ /* 98/06/01 */ - NULL, /* value type not required */ /* 98/06/01 */ - (LPBYTE)&SubNetMasks, /* address of value data */ /* 98/06/01 */ - &sizeofsubnetmasks); /* length of value data */ /* 98/06/01 */ + RegQueryValueEx(hksub, /* subkey handle */ + maskkeyname, /* value name */ + NULL, /* must be zero */ + NULL, /* value type not required */ + (LPBYTE)&SubNetMasks, /* address of value data */ + &sizeofsubnetmasks); /* length of value data */ if(bSuccess != ERROR_SUCCESS) { msyslog(LOG_ERR, "Error in RegQueryValueEx fetching SubNetMask parameter: %m"); @@ -2580,7 +2577,7 @@ get_winnt_interfaces( RegCloseKey(hksub); /* ok now that we have some addresses and subnet masks go through each one and add to our structure... */ /* multi_sz strings are terminated by two \0 in a row */ - /* however, the dhcp strings are not multi_sz, they are just plain strings */ /* 98/06/01 */ + /* however, the dhcp strings are not multi_sz, they are just plain strings */ ipptr = IpAddresses; subptr = SubNetMasks; @@ -2598,13 +2595,13 @@ get_winnt_interfaces( /* now add to interface structure */ if (!Done) { - ifr = (struct ifreq *)ifc_buffer; /* 98/06/02 */ - ip = inet_addr(oneIpAddress); /* 98/06/01 *//* 98/06/02 */ - broad = ~inet_addr(oneSubNetMask) | ip; /* 98/06/01 *//* 98/06/02 */ + ifr = (struct ifreq *)ifc_buffer; + ip = inet_addr(oneIpAddress); + broad = ~inet_addr(oneSubNetMask) | ip; ifr->ifr_addr.sa_family = AF_INET; - ((struct sockaddr_in *)&ifr->ifr_addr)->sin_addr.s_addr = ip; /* 98/06/01 */ - ifr->ifr_broadaddr.sa_family = AF_INET; /* 98/06/01 */ - ((struct sockaddr_in *)&ifr->ifr_broadaddr)->sin_addr.s_addr = broad; /* 98/06/01 */ + ((struct sockaddr_in *)&ifr->ifr_addr)->sin_addr.s_addr = ip; + ifr->ifr_broadaddr.sa_family = AF_INET; + ((struct sockaddr_in *)&ifr->ifr_broadaddr)->sin_addr.s_addr = broad; strcpy(ifr->ifr_mask,oneSubNetMask); if (strlen(servicename) > 15) @@ -2612,9 +2609,9 @@ get_winnt_interfaces( else strcpy(ifr->ifr_name,servicename); /* now increment pointer */ - ifc_buffer += sizeof(struct ifreq); /* 98/06/02 */ + ifc_buffer += sizeof(struct ifreq); ++count; - if (((char *)ipptr == '\0') || ((char *)subptr == '\0') || (enableDhcp)) /* 98/06/01 */ + if (((char *)ipptr == '\0') || ((char *)subptr == '\0') || (enableDhcp)) Done = 1; } } @@ -2622,24 +2619,23 @@ get_winnt_interfaces( } /* it is/not a temporary ndiswan name */ } /* end of loop */ - /* 98/06/02 */ - /* add the loopback interface */ /* 98/06/02 */ - ifr = (struct ifreq *)ifc_buffer; /* 98/06/02 */ - ip = inet_addr("127.0.0.1"); /* 98/06/01 *//* 98/06/02 */ - broad = ~inet_addr("255.0.0.0") | ip; /* 98/06/01 *//* 98/06/02 */ - ifr->ifr_addr.sa_family = AF_INET; /* 98/06/02 */ - ((struct sockaddr_in *)&ifr->ifr_addr)->sin_addr.s_addr = ip; /* 98/06/01 *//* 98/06/02 */ - ifr->ifr_broadaddr.sa_family = AF_INET; /* 98/06/01 *//* 98/06/02 */ - ((struct sockaddr_in *)&ifr->ifr_broadaddr)->sin_addr.s_addr = broad; /* 98/06/01 *//* 98/06/02 */ - strcpy(ifr->ifr_mask,"255.0.0.0"); /* 98/06/02 */ - strcpy(ifr->ifr_name,"loopback"); /* 98/06/02 */ - /* 98/06/02 */ - /* now increment pointer */ /* 98/06/02 */ - ifc_buffer += sizeof(struct ifreq); /* 98/06/02 */ - ++count; /* 98/06/02 */ - /* 98/06/02 */ + /* add the loopback interface */ + ifr = (struct ifreq *)ifc_buffer; + ip = inet_addr("127.0.0.1"); + broad = ~inet_addr("255.0.0.0") | ip; + ifr->ifr_addr.sa_family = AF_INET; + ((struct sockaddr_in *)&ifr->ifr_addr)->sin_addr.s_addr = ip; + ifr->ifr_broadaddr.sa_family = AF_INET; + ((struct sockaddr_in *)&ifr->ifr_broadaddr)->sin_addr.s_addr = broad; + strcpy(ifr->ifr_mask,"255.0.0.0"); + strcpy(ifr->ifr_name,"loopback"); + + /* now increment pointer */ + ifc_buffer += sizeof(struct ifreq); + ++count; + /* now reset the length */ - ifc->ifc_len = count * (sizeof(struct ifreq)); /* 98/06/02 */ + ifc->ifc_len = count * (sizeof(struct ifreq)); return 0; } diff --git a/ntpd/ntp_peer.c b/ntpd/ntp_peer.c index 8257ab6cfe..d8e5d9f8f2 100644 --- a/ntpd/ntp_peer.c +++ b/ntpd/ntp_peer.c @@ -302,11 +302,17 @@ findpeer( } } -printf("pkt_mode %d action %d\n", pkt_mode, *action); +#ifdef DEBUG + if (debug) + printf("pkt_mode %d action %d\n", pkt_mode, *action); +#endif /* if no matching association is found */ if (peer == 0) { *action = MATCH_ASSOC(NO_PEER, pkt_mode); -printf("pkt_mode %d action %d\n", pkt_mode, *action); +#ifdef DEBUG + if (debug) + printf("pkt_mode %d action %d\n", pkt_mode, *action); +#endif return (struct peer *)0; } diff --git a/ntpd/ntp_timer.c b/ntpd/ntp_timer.c index 11f18b0c53..e685047c28 100644 --- a/ntpd/ntp_timer.c +++ b/ntpd/ntp_timer.c @@ -12,7 +12,7 @@ #include #include -#include "ntp_machine.h" /* 98/06/03 */ +#include "ntp_machine.h" #include "ntpd.h" #include "ntp_stdlib.h" @@ -92,7 +92,7 @@ init_timer(void) extern HANDLE hMutex; UINT wTimerRes, wTimerID; # endif /* SYS_WINNT */ -#if defined(SYS_CYGWIN32) || defined(SYS_WINNT) /* 98/06/03 */ +#if defined(SYS_CYGWIN32) || defined(SYS_WINNT) HANDLE hToken; TOKEN_PRIVILEGES tkp; #endif @@ -239,24 +239,24 @@ timer(void) { register struct peer *peer, *next_peer; int n; -#ifdef SYS_WINNT /* 98/05/29 */ - extern HANDLE hMutex; /* 98/06/03 */ - DWORD dwWaitResult; /* 98/06/03 */ - /* 98/06/03 */ - dwWaitResult = WaitForSingleObject( /* 98/06/03 */ - hMutex, /* handle of mutex */ /* 98/06/03 */ - 5000L); /* five-second time-out interval */ /* 98/06/03 */ - /* 98/06/03 */ - switch (dwWaitResult) { /* 98/06/03 */ - case WAIT_OBJECT_0: /* 98/06/03 */ - /* The thread got mutex ownership. */ /* 98/06/03 */ - break; /* 98/06/03 */ - default: /* 98/06/03 */ - /* Cannot get mutex ownership due to time-out. */ /* 98/06/03 */ - msyslog(LOG_ERR, "timer() cannot obtain mutex: %m\n"); /* 98/06/03 */ - exit(1); /* 98/06/03 */ - } /* 98/06/03 */ -#endif /* 98/05/29 */ +#ifdef SYS_WINNT + extern HANDLE hMutex; + DWORD dwWaitResult; + + dwWaitResult = WaitForSingleObject( + hMutex, /* handle of mutex */ + 5000L); /* five-second time-out interval */ + + switch (dwWaitResult) { + case WAIT_OBJECT_0: + /* The thread got mutex ownership. */ + break; + default: + /* Cannot get mutex ownership due to time-out. */ + msyslog(LOG_ERR, "timer() cannot obtain mutex: %m\n"); + exit(1); + } +#endif current_time += (1< # include -#else /* 98/05/28 */ -# include /* 98/05/28 */ +#else +# include #endif /* SYS_WINNT */ #ifdef SYS_VXWORKS @@ -195,7 +195,7 @@ static struct server *clock_select P((void)); static int clock_adjust P((void)); static void addserver P((char *)); static struct server *findserver P((struct sockaddr_in *)); - void timer P((void)); /* 98/06/03 */ + void timer P((void)); static void init_alarm P((void)); #ifndef SYS_WINNT static RETSIGTYPE alarming P((int)); @@ -213,10 +213,10 @@ static int getnetnum P((const char *, u_int32 *)); static void printserver P((struct server *, FILE *)); #ifdef SYS_WINNT -int on = 1; /* 98/06/03 */ -WORD wVersionRequested; /* 98/06/03 */ -WSADATA wsaData; /* 98/06/03 */ -HANDLE TimerThreadHandle = NULL; /* 98/06/03 */ +int on = 1; +WORD wVersionRequested; +WSADATA wsaData; +HANDLE TimerThreadHandle = NULL; #endif /* SYS_WINNT */ #ifdef NO_MAIN_ALLOWED @@ -1358,7 +1358,7 @@ init_alarm(void) #if defined SYS_CYGWIN32 || defined SYS_WINNT HANDLE hToken; TOKEN_PRIVILEGES tkp; - DWORD dwUser = 0; /* 98/05/28 */ + DWORD dwUser = 0; #endif /* SYS_WINNT */ alarm_flag = 0; diff --git a/ntpq/ntpq_ops.c b/ntpq/ntpq_ops.c index c57367ef1f..2386976ddd 100644 --- a/ntpq/ntpq_ops.c +++ b/ntpq/ntpq_ops.c @@ -179,7 +179,7 @@ char flash2[] = " .+* "; /* flash decode for version 2 */ char flash3[] = " x.-+#*o"; /* flash decode for peer status version 3 */ struct varlist { - const char *name; /* 98/06/04 */ + const char *name; char *value; } varlist[MAXLIST] = { { 0, 0 } };