Browse Source

implement -S to override earlier -s, requested by theo

OPENBSD_3_7
henning 20 years ago
parent
commit
8cf519f664
2 changed files with 11 additions and 5 deletions
  1. +5
    -2
      src/usr.sbin/ntpd/ntpd.8
  2. +6
    -3
      src/usr.sbin/ntpd/ntpd.c

+ 5
- 2
src/usr.sbin/ntpd/ntpd.8 View File

@ -1,4 +1,4 @@
.\" $OpenBSD: ntpd.8,v 1.7 2004/09/18 20:31:46 henning Exp $ .\" $OpenBSD: ntpd.8,v 1.8 2004/09/18 20:37:12 henning Exp $
.\" .\"
.\" Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> .\" Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
.\" .\"
@ -23,7 +23,7 @@
.Sh SYNOPSIS .Sh SYNOPSIS
.Nm ntpd .Nm ntpd
.Bk -words .Bk -words
.Op Fl ds .Op Fl dsS
.Op Fl f Ar file .Op Fl f Ar file
.Ek .Ek
.Sh DESCRIPTION .Sh DESCRIPTION
@ -80,6 +80,9 @@ Set the time immediately once at startup if the local clock is off by more
than 180 seconds. Allows for a large time correction, than 180 seconds. Allows for a large time correction,
eliminating the need to run rdate before starting eliminating the need to run rdate before starting
.Nm . .Nm .
.It Fl S
Do not set the time immediately at startup.
This is the default.
.El .El
.Sh FILES .Sh FILES
.Bl -tag -width "/etc/ntpd.confXXX" -compact .Bl -tag -width "/etc/ntpd.confXXX" -compact


+ 6
- 3
src/usr.sbin/ntpd/ntpd.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: ntpd.c,v 1.19 2004/09/18 20:27:57 henning Exp $ */ /* $OpenBSD: ntpd.c,v 1.20 2004/09/18 20:37:12 henning Exp $ */
/* /*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -68,7 +68,7 @@ usage(void)
{ {
extern char *__progname; extern char *__progname;
fprintf(stderr, "usage: %s [-d] [-f file] [-s]\n", __progname); fprintf(stderr, "usage: %s [-dsS] [-f file]\n", __progname);
exit(1); exit(1);
} }
@ -91,7 +91,7 @@ main(int argc, char *argv[])
log_init(1); /* log to stderr until daemonized */ log_init(1); /* log to stderr until daemonized */
while ((ch = getopt(argc, argv, "df:s")) != -1) { while ((ch = getopt(argc, argv, "df:sS")) != -1) {
switch (ch) { switch (ch) {
case 'd': case 'd':
conf.debug = 1; conf.debug = 1;
@ -102,6 +102,9 @@ main(int argc, char *argv[])
case 's': case 's':
conf.settime = 1; conf.settime = 1;
break; break;
case 'S':
conf.settime = 0;
break;
default: default:
usage(); usage();
/* NOTREACHED */ /* NOTREACHED */


|||||||
|||||||
xxxxxxxxxx
 
000:0
x
 
000:0
Loading…
Cancel
Save