diff options
| author | Paul Traina <pst@FreeBSD.org> | 1994-09-27 18:30:26 +0000 |
|---|---|---|
| committer | Paul Traina <pst@FreeBSD.org> | 1994-09-27 18:30:26 +0000 |
| commit | 45fe7a082aab8af41302a0cff7c1d73f0d342eca (patch) | |
| tree | 3f1cfe106458275e6a56a1077732949bec70f20e /usr.sbin/xntpd | |
| parent | d3c2cf7a806c3d12580dc8ae7a816247fe4aa1c0 (diff) | |
Notes
Diffstat (limited to 'usr.sbin/xntpd')
| -rw-r--r-- | usr.sbin/xntpd/Makefile.inc | 2 | ||||
| -rw-r--r-- | usr.sbin/xntpd/xntpd/ntp_unixclock.c | 15 |
2 files changed, 16 insertions, 1 deletions
diff --git a/usr.sbin/xntpd/Makefile.inc b/usr.sbin/xntpd/Makefile.inc index f38f0a91a3dc..28ff2208f67a 100644 --- a/usr.sbin/xntpd/Makefile.inc +++ b/usr.sbin/xntpd/Makefile.inc @@ -1,5 +1,5 @@ DEFS_LOCAL=-DREFCLOCK -DPARSE -NTPDEFS= -DSYS_FREEBSD -DSYS_386BSD +NTPDEFS= -DSYS_FREEBSD -DSYS_386BSD -DHAVE_GETBOOTFILE AUTHDEFS= -DMD5 CLOCKDEFS= -DLOCAL_CLOCK -DPST -DWWVB -DAS2201 -DGOES -DGPSTM -DOMEGA \ -DLEITCH -DTRAK diff --git a/usr.sbin/xntpd/xntpd/ntp_unixclock.c b/usr.sbin/xntpd/xntpd/ntp_unixclock.c index 1950d8c06fb3..df728f0c488b 100644 --- a/usr.sbin/xntpd/xntpd/ntp_unixclock.c +++ b/usr.sbin/xntpd/xntpd/ntp_unixclock.c @@ -14,6 +14,10 @@ #include <utmp.h> #endif +#if defined(HAVE_GETBOOTFILE) +#include <paths.h> +#endif + #include "ntpd.h" #include "ntp_io.h" #include "ntp_unixtime.h" @@ -309,7 +313,11 @@ clock_parms(tickadj, tick) {""}, }; #endif +#ifdef HAVE_GETBOOTFILE + const char *kernelname; +#else static char *kernelnames[] = { + "/kernel", "/vmunix", "/unix", "/mach", @@ -321,6 +329,7 @@ clock_parms(tickadj, tick) #endif NULL }; +#endif struct stat stbuf; int vars[2]; @@ -331,6 +340,11 @@ clock_parms(tickadj, tick) * Check to see what to use for the object file for names and get * the locations of the necessary kernel variables. */ +#ifdef HAVE_GETBOOTFILE + kernelname = getbootfile(); + if (kernelname && + ((stat(kernelname, &stbuf) == -1) || (nlist(kernelname, nl) < 0))) { +#else for (i = 0; kernelnames[i] != NULL; i++) { if (stat(kernelnames[i], &stbuf) == -1) continue; @@ -338,6 +352,7 @@ clock_parms(tickadj, tick) break; } if (kernelnames[i] == NULL) { +#endif syslog(LOG_ERR, "Clock init couldn't find kernel object file"); exit(3); |
