From 699090cc2eb8cb9c579280d8de1de6d91c2c2157 Mon Sep 17 00:00:00 2001 From: wollman Date: Fri, 30 Sep 1994 00:34:21 +0000 Subject: [PATCH] Make it compile under 2.0. --- usr.sbin/xntpd/Makefile.inc | 5 +++-- usr.sbin/xntpd/include/ntp_machine.h | 2 ++ usr.sbin/xntpd/lib/msyslog.c | 3 +++ usr.sbin/xntpd/xntpd/Makefile | 18 ++++++++++-------- usr.sbin/xntpd/xntpd/ntp_config.c | 4 ++-- usr.sbin/xntpd/xntpd/refclock_parse.c | 8 ++++---- 6 files changed, 24 insertions(+), 16 deletions(-) diff --git a/usr.sbin/xntpd/Makefile.inc b/usr.sbin/xntpd/Makefile.inc index 28ff2208f67a..c322560b6eb8 100644 --- a/usr.sbin/xntpd/Makefile.inc +++ b/usr.sbin/xntpd/Makefile.inc @@ -1,7 +1,8 @@ DEFS_LOCAL=-DREFCLOCK -DPARSE -NTPDEFS= -DSYS_FREEBSD -DSYS_386BSD -DHAVE_GETBOOTFILE +NTPDEFS= -DSYS_FREEBSD -DSYS_44BSD AUTHDEFS= -DMD5 CLOCKDEFS= -DLOCAL_CLOCK -DPST -DWWVB -DAS2201 -DGOES -DGPSTM -DOMEGA \ - -DLEITCH -DTRAK + -DLEITCH -DTRAK -DACTS -DATOM -DDATUM -DHEATH -DMSFEES \ + -DMX4200 -DNMEA -DWWVB CFLAGS+= ${NTPDEFS} ${DEFS_LOCAL} ${AUTHDEFS} ${CLOCKDEFS} ${COPTS} BINDIR?= /usr/sbin diff --git a/usr.sbin/xntpd/include/ntp_machine.h b/usr.sbin/xntpd/include/ntp_machine.h index 2051de175234..2a8c9d1532d9 100644 --- a/usr.sbin/xntpd/include/ntp_machine.h +++ b/usr.sbin/xntpd/include/ntp_machine.h @@ -375,6 +375,7 @@ in this file. #define HAVE_LIBKVM #define NTP_POSIX_SOURCE #define HAVE_BSD_NICE +#define USE_PROTOTYPES #ifndef STR_SYSTEM #define STR_SYSTEM "UNIX/4.4BSD" #endif @@ -382,6 +383,7 @@ in this file. #define HAVE_TERMIOS #define HAVE_UNAME #define HAVE_SYS_TIMEX_H +#define HAVE_GETBOOTFILE #define NTP_SYSCALLS_LIBC #define KERNEL_PLL #endif diff --git a/usr.sbin/xntpd/lib/msyslog.c b/usr.sbin/xntpd/lib/msyslog.c index aca016bb6b77..d71b0755d549 100644 --- a/usr.sbin/xntpd/lib/msyslog.c +++ b/usr.sbin/xntpd/lib/msyslog.c @@ -47,7 +47,10 @@ void msyslog(va_alist) const char *err; register int c, l; register char *n, *f, *prog; +#ifndef SYS_44BSD extern int sys_nerr; + extern char *sys_errlist[]; +#endif int olderrno; #ifdef __STDC__ diff --git a/usr.sbin/xntpd/xntpd/Makefile b/usr.sbin/xntpd/xntpd/Makefile index b10d3764af6d..4ed30b46e71d 100644 --- a/usr.sbin/xntpd/xntpd/Makefile +++ b/usr.sbin/xntpd/xntpd/Makefile @@ -1,5 +1,5 @@ # -# $Id: Makefile,v 1.4 1994/02/03 23:23:17 wollman Exp $ +# $Id: Makefile,v 1.5 1994/04/03 20:37:26 wollman Exp $ # CFLAGS+= -I${.CURDIR}/../include @@ -20,7 +20,7 @@ LDADD+= -L${.CURDIR}/../parse DPADD+= ${.CURDIR}/../parse/libparse.a .endif -LDADD+= -lntp -lparse +LDADD+= -lntp -lparse -lkvm PROG= xntpd MAN8= ${.CURDIR}/../doc/xntpd.8 @@ -29,14 +29,16 @@ CLEANFILES+= .version version.c SRCS= ntp_config.c ntp_control.c ntp_io.c ntp_leap.c \ ntp_loopfilter.c ntp_monitor.c ntp_peer.c ntp_proto.c \ ntp_refclock.c ntp_request.c ntp_restrict.c ntp_timer.c \ - ntp_unixclock.c ntp_util.c ntpd.c refclock_chu.c \ - refclock_conf.c refclock_local.c refclock_pst.c \ - refclock_wwvb.c refclock_goes.c refclock_mx4200.c \ - refclock_parse.c refclock_as2201.c refclock_omega.c \ - refclock_tpro.c refclock_leitch.c refclock_irig.c \ - refclock_msfees.c refclock_gpstm.c refclock_trak.c ntp_intres.c \ + ntp_unixclock.c ntp_util.c ntpd.c ntp_intres.c \ ntp_filegen.c version.c +# refclocks +SRCS+= refclock_acts.c refclock_as2201.c refclock_atom.c refclock_chu.c \ + refclock_conf.c refclock_datum.c refclock_goes.c refclock_gpstm.c \ + refclock_heath.c refclock_leitch.c refclock_local.c refclock_moto.c \ + refclock_msfees.c refclock_mx4200.c refclock_nmea.c refclock_omega.c \ + refclock_parse.c refclock_pst.c refclock_trak.c refclock_wwvb.c + beforedepend: version.c version.c: ${.CURDIR}/../VERSION diff --git a/usr.sbin/xntpd/xntpd/ntp_config.c b/usr.sbin/xntpd/xntpd/ntp_config.c index 385e53623f8e..202a029e7b6b 100644 --- a/usr.sbin/xntpd/xntpd/ntp_config.c +++ b/usr.sbin/xntpd/xntpd/ntp_config.c @@ -1642,7 +1642,7 @@ abort_resolve() } -#define KEY_TYPE_ASCII 3 +#define KEY_TYPE_MD5 4 /* * do_resolve_internal - start up the resolver function (not program) @@ -1684,7 +1684,7 @@ do_resolve_internal() for (i = 0; i < 8; i++) rankey[i] = (rand() % 255) + 1; rankey[8] = 0; - authusekey(req_keyid, KEY_TYPE_ASCII, rankey); + authusekey(req_keyid, KEY_TYPE_MD5, rankey); } /* save keyid so we will accept config requests with it */ diff --git a/usr.sbin/xntpd/xntpd/refclock_parse.c b/usr.sbin/xntpd/xntpd/refclock_parse.c index 7ef54ab60ab9..089e2c34dccb 100644 --- a/usr.sbin/xntpd/xntpd/refclock_parse.c +++ b/usr.sbin/xntpd/xntpd/refclock_parse.c @@ -242,7 +242,7 @@ struct parseunit /* * type specific parameters */ - struct clockinfo *parse_type; /* link to clock description */ + struct my_clockinfo *parse_type; /* link to clock description */ /* * clock specific configuration @@ -536,7 +536,7 @@ static int trimbletsip_init P((struct parseunit *)); #define TRIMBLETAIP_EOL '<' -static struct clockinfo +static struct my_clockinfo { U_LONG cl_flags; /* operation flags (io modes) */ void (*cl_poll)(); /* active poll routine */ @@ -749,7 +749,7 @@ static struct clockinfo } }; -static int ncltypes = sizeof(clockinfo) / sizeof(struct clockinfo); +static int ncltypes = sizeof(clockinfo) / sizeof(struct my_clockinfo); #define CL_REALTYPE(x) (((x) >> 2) & 0x1F) #define CL_TYPE(x) ((CL_REALTYPE(x) >= ncltypes) ? ~0 : CL_REALTYPE(x)) @@ -1718,7 +1718,7 @@ local_poll(parse) while (i-- > 0) { - if (parse_ioread(&parse->parseio, *s++, ts)) + if (parse_ioread(&parse->parseio, *s++, &ts)) { /* * got something good to eat