summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorwollman <wollman@FreeBSD.org>1994-02-03 22:30:59 +0000
committerwollman <wollman@FreeBSD.org>1994-02-03 22:30:59 +0000
commit601956bba379692f40f33ff62a49be5f76eddfb7 (patch)
treed8e83df7b4f007cdcc7420d9c1b9c51b00fa4d40 /usr.sbin
parent285f4cc444ddb305f97a4d704855f7e2a6e420e2 (diff)
downloadFreeBSD-src-601956bba379692f40f33ff62a49be5f76eddfb7.zip
FreeBSD-src-601956bba379692f40f33ff62a49be5f76eddfb7.tar.gz
Merged changes along vendor branch into locally-modified files.
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/xntpd/Makefile1
-rw-r--r--usr.sbin/xntpd/README.FreeBSD2
-rw-r--r--usr.sbin/xntpd/lib/authdes.c.export2
-rw-r--r--usr.sbin/xntpd/util/tickadj.c31
4 files changed, 17 insertions, 19 deletions
diff --git a/usr.sbin/xntpd/Makefile b/usr.sbin/xntpd/Makefile
index cda87fc..8d724c5 100644
--- a/usr.sbin/xntpd/Makefile
+++ b/usr.sbin/xntpd/Makefile
@@ -1,5 +1,6 @@
#
# Makefile for xntpd.
+# $Id$
#
SUBDIR= lib parse xntpd xntpdc ntpq ntpdate ntptrace xntpres authstuff util
diff --git a/usr.sbin/xntpd/README.FreeBSD b/usr.sbin/xntpd/README.FreeBSD
index 5396e79..437d478 100644
--- a/usr.sbin/xntpd/README.FreeBSD
+++ b/usr.sbin/xntpd/README.FreeBSD
@@ -1,6 +1,6 @@
This version of NTP was converted to the BSD-style Makefile system by
Garrett Wollman (wollman@freefall.cdrom.com); it is based on version
-3.3b (beta) from the University of Delaware.
+3.3z (late beta) from the University of Delaware.
Besides the Makefile changes, the DES code has been completely removed
in order to make this code exportable. If you have a legal copy of
diff --git a/usr.sbin/xntpd/lib/authdes.c.export b/usr.sbin/xntpd/lib/authdes.c.export
index 5dfbde8..a63c6d3 100644
--- a/usr.sbin/xntpd/lib/authdes.c.export
+++ b/usr.sbin/xntpd/lib/authdes.c.export
@@ -15,7 +15,7 @@
* to its exportable state, copy this file to authdes.c .
*/
#include <sys/types.h>
-#include "ntp_types.h"
+#include "ntp_stdlib.h"
/*
* This routine is normally called to compute the key schedule.
diff --git a/usr.sbin/xntpd/util/tickadj.c b/usr.sbin/xntpd/util/tickadj.c
index 1c79ea1..ab10b37 100644
--- a/usr.sbin/xntpd/util/tickadj.c
+++ b/usr.sbin/xntpd/util/tickadj.c
@@ -61,9 +61,6 @@ static char * getoffsets P((char *, unsigned long *, unsigned long *, unsigned l
static int openfile P((char *, int));
static void writevar P((int, unsigned long, int));
static void readvar P((int, unsigned long, int *));
-#ifndef NTP_POSIX_SOURCE
-extern int getopt_l P((int, char **, char *));
-#endif
/*
* main - parse arguments and handle options
@@ -75,8 +72,8 @@ char *argv[];
{
int c;
int errflg = 0;
- extern int optind;
- extern char *optarg;
+ extern int ntp_optind;
+ extern char *ntp_optarg;
unsigned long tickadj_offset;
unsigned long tick_offset;
unsigned long dosync_offset;
@@ -94,7 +91,7 @@ char *argv[];
void writevar();
progname = argv[0];
- while ((c = getopt_l(argc, argv, "a:Adkqpst:")) != EOF)
+ while ((c = ntp_getopt(argc, argv, "a:Adkqpst:")) != EOF)
switch (c) {
case 'd':
++debug;
@@ -109,11 +106,11 @@ char *argv[];
quiet = 1;
break;
case 'a':
- writetickadj = atoi(optarg);
+ writetickadj = atoi(ntp_optarg);
if (writetickadj <= 0) {
(void) fprintf(stderr,
"%s: unlikely value for tickadj: %s\n",
- progname, optarg);
+ progname, ntp_optarg);
errflg++;
}
break;
@@ -124,11 +121,11 @@ char *argv[];
unsetdosync = 1;
break;
case 't':
- writetick = atoi(optarg);
+ writetick = atoi(ntp_optarg);
if (writetick <= 0) {
(void) fprintf(stderr,
"%s: unlikely value for tick: %s\n",
- progname, optarg);
+ progname, ntp_optarg);
errflg++;
}
break;
@@ -136,7 +133,7 @@ char *argv[];
errflg++;
break;
}
- if (errflg || optind != argc) {
+ if (errflg || ntp_optind != argc) {
(void) fprintf(stderr,
"usage: %s [-Aqsp] [-a newadj] [-t newtick]\n", progname);
exit(2);
@@ -154,25 +151,25 @@ char *argv[];
if (setnoprintf && (noprintf_offset == 0)) {
(void) fprintf(stderr,
"No noprintf kernal variable\n");
- exit(1);
+ errflg++;
}
if (unsetdosync && (dosync_offset == 0)) {
(void) fprintf(stderr,
"No dosynctodr kernal variable\n");
- exit(1);
+ errflg++;
}
if (writeopttickadj && (tickadj_offset == 0)) {
(void) fprintf(stderr,
"No tickadj kernal variable\n");
- exit(1);
+ errflg++;
}
if (writetick && (tick_offset == 0)) {
(void) fprintf(stderr,
"No tick kernal variable\n");
- exit(1);
+ errflg++;
}
@@ -234,7 +231,7 @@ char *argv[];
if (writetickadj == 0 && !writeopttickadj &&
!unsetdosync && writetick == 0 && !setnoprintf)
- exit(0);
+ exit(errflg ? 1 : 0);
if (writetickadj == 0 && writeopttickadj)
writetickadj = recommend_tickadj;
@@ -283,7 +280,7 @@ char *argv[];
(void) fprintf(stderr, "done!\n");
}
(void) close(fd);
- exit(0);
+ exit(errflg ? 1 : 0);
}
/*
OpenPOWER on IntegriCloud