2000-05-13 Harlan Stenn <stenn@whimsy.udel.edu>
+ * ntpdate/ntptimeset.c:
+ * ntpdate/ntpdate.h:
+ * ntpd/refclock_oncore.c (oncore_msg_En):
+ * ntpd/ntp_util.c (stats_config):
+ * ntpd/ntp_request.c:
+ * ntpd/ntp_intres.c (findhostaddr):
+ * ntpd/ntp_config.c (getconfig):
+ * libntp/systime.c (adj_systime):
+ * libntp/lib_strbuf.c:
+ * libntp/authparity.c:
+ * libntp/audio.c:
+ Header/lint cleanup
+ From/reported by: Simon Burge <simonb@netbsd.org>
+
* ntpd/ntp_resolver.c (findhostaddr): Compiler noise cleanup
* ntpd/ntp_intres.c: Compiler noise cleanup
#endif
#include "audio.h"
-#include <unistd.h>
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif
#include <stdio.h>
+#include "ntp_string.h"
#ifdef HAVE_SYS_AUDIOIO_H
#include <sys/audioio.h>
/*
* auth_parity - set parity on a key/check for odd parity
*/
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#ifdef DES
#include "ntp_stdlib.h"
int
*/
return (parity_err == 0);
}
+#endif /* DES */
* lib_strbuf - library string storage
*/
+#include "ntp_stdlib.h"
#include "lib_strbuf.h"
/*
/* casey - we need a posix type thang here */
if (adjtime(&adjtv, &oadjtv) < 0)
{
- msyslog(LOG_ERR, "Can't adjust time (%d sec, %d usec): %m",
- adjtv.tv_sec, adjtv.tv_usec);
+ msyslog(LOG_ERR, "Can't adjust time (%ld sec, %ld usec): %m",
+ (long)adjtv.tv_sec, (long)adjtv.tv_usec);
return 0;
}
else {
int minpoll;
int maxpoll;
int ttl;
+ unsigned long ul;
keyid_t peerkey;
char *peerkeystr;
keyid_t lpeerkey;
case CONFIG_REQUESTKEY:
if (ntokens >= 2) {
- keyid_t rkey;
-
- if (!atouint(tokens[1], &rkey)) {
+ if (!atouint(tokens[1], &ul)) {
msyslog(LOG_ERR,
"%s is undecodable as request key",
tokens[1]);
- } else if (rkey == 0) {
+ } else if (ul == 0) {
msyslog(LOG_ERR,
"%s makes a poor request keyid",
tokens[1]);
#ifdef DEBUG
if (debug > 3)
printf(
- "set info_auth_key to %08x\n", rkey);
+ "set info_auth_key to %08lx\n", ul);
#endif
- info_auth_keyid = rkey;
+ info_auth_keyid = (keyid_t)ul;
}
}
break;
case CONF_FDG_FLAG2:
case CONF_FDG_FLAG3:
case CONF_FDG_FLAG4:
- if (!atouint(tokens[++i], &lpeerkey)
- || lpeerkey > 1) {
+ if (!atouint(tokens[++i], &ul)
+ || ul > 1) {
msyslog(LOG_ERR,
"fudge %s flag value in error",
ntoa(&peeraddr));
+ lpeerkey = (keyid_t)ul;
peerkey = lpeerkey;
errflg = i;
break;
)
{
struct hostent *hp;
+ struct in_addr in;
checkparent(); /* make sure our guy is still running */
msyslog(LOG_INFO, "findhostaddr: Resolving %x>",
entry->ce_peeraddr);
#endif
- hp = gethostbyaddr((const char *)entry->ce_peeraddr,
+ in.s_addr = entry->ce_peeraddr;
+ hp = gethostbyaddr((const char *)&in,
sizeof entry->ce_peeraddr,
AF_INET);
}
* ntp_request.c - respond to information requests
*/
#ifdef HAVE_CONFIG_H
-#include <config.h>
+# include <config.h>
#endif
#include <sys/types.h>
#include <stdio.h>
#include <signal.h>
#include <sys/time.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
#include "ntpd.h"
#include "ntp_io.h"
if (proc->sizeofitem != 0)
if (proc->sizeofitem*INFO_NITEMS(inpkt->err_nitems)
> sizeof(inpkt->data)) {
- msyslog(LOG_ERR, "sizeofitem(%d)*NITEMS(%d) > data: %d > %d",
+ msyslog(LOG_ERR, "sizeofitem(%d)*NITEMS(%d) > data: %d > %ld",
proc->sizeofitem, INFO_NITEMS(inpkt->err_nitems),
proc->sizeofitem*INFO_NITEMS(inpkt->err_nitems),
- sizeof(inpkt->data));
+ (long)sizeof(inpkt->data));
req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
return;
}
struct req_pkt *inpkt
)
{
+ int fl;
register struct conf_peer *cp;
register int items;
struct sockaddr_in peeraddr;
- int fl;
/*
* Do a check of everything to see that it looks
while (items-- > 0) {
u_short associd;
size_t hnl;
- char *cp;
struct peer *peer;
int bogon = 0;
peeraddr.sin_addr.s_addr = dp->peeraddr;
for (hnl = 0; dp->hostname[hnl] && hnl < sizeof dp->hostname; ++hnl) ;
if (hnl >= sizeof dp->hostname) {
- msyslog(LOG_ERR, "dns_a: hnl (%d) >= %d",
- hnl, sizeof dp->hostname);
+ msyslog(LOG_ERR, "dns_a: hnl (%ld) >= %ld",
+ (long)hnl, (long)sizeof dp->hostname);
++bogon;
}
if (flags & ~(SYS_FLAG_BCLIENT | SYS_FLAG_AUTHENTICATE |
SYS_FLAG_NTP | SYS_FLAG_KERNEL | SYS_FLAG_MONITOR |
SYS_FLAG_FILEGEN)) {
- msyslog(LOG_ERR, "setclr_flags: extra flags: %#x",
+ msyslog(LOG_ERR, "setclr_flags: extra flags: %#lx",
flags & ~(SYS_FLAG_BCLIENT | SYS_FLAG_AUTHENTICATE |
SYS_FLAG_NTP | SYS_FLAG_KERNEL |
SYS_FLAG_MONITOR | SYS_FLAG_FILEGEN));
flags = ((struct reset_flags *)inpkt->data)->flags;
if (flags & ~RESET_ALLFLAGS) {
- msyslog(LOG_ERR, "reset_stats: reset leaves %#x",
+ msyslog(LOG_ERR, "reset_stats: reset leaves %#lx",
flags & ~RESET_ALLFLAGS);
req_ack(srcadr, inter, inpkt, INFO_ERR_FMT);
return;
(void) fclose(fp);
if ( !finite(old_drift)
|| (fabs(old_drift) > (sys_maxfreq * 1e6))) {
- msyslog(LOG_ERR, "invalid frequency (%lf) in %s",
+ msyslog(LOG_ERR, "invalid frequency (%f) in %s",
old_drift, stats_drift_file);
exit(1);
}
if (debug > 2)
printf("ONCORE: serial/j (%lu, %d) %ld.%09ld\n",
- pps_i.assert_sequence, j, tsp->tv_sec, tsp->tv_nsec);
+ (long)pps_i.assert_sequence, j,
+ (long)tsp->tv_sec, (long)tsp->tv_nsec);
if (pps_i.assert_sequence == j) {
printf("ONCORE: oncore_msg_En, error serial pps\n");
#include "ntp_malloc.h"
+extern void loadservers P((char *cfgpath));
+
/*
* The server structure is a much simplified version of the
* peer structure, for ntpdate's use. Since we always send
int ntptimesetmain P((int argc, char *argv[]));
-extern void loadservers P((char *cfgpath));
static void analysis P((int final));
static int have_enough P((void));
static void transmit P((register struct server *server));