diff options
author | Jakob Schlyter <jakob@cvs.openbsd.org> | 2002-07-27 09:29:51 +0000 |
---|---|---|
committer | Jakob Schlyter <jakob@cvs.openbsd.org> | 2002-07-27 09:29:51 +0000 |
commit | 59eef5004fa132d8789835f16481a49857d3a61a (patch) | |
tree | 24f04f81e02d9b4ca78e42f885c35816b73cf522 /usr.sbin/rdate | |
parent | 96781ad7f6b24d1bced786b252090e3e1fc684d8 (diff) |
add verbose output option
Diffstat (limited to 'usr.sbin/rdate')
-rw-r--r-- | usr.sbin/rdate/rdate.8 | 6 | ||||
-rw-r--r-- | usr.sbin/rdate/rdate.c | 15 |
2 files changed, 14 insertions, 7 deletions
diff --git a/usr.sbin/rdate/rdate.8 b/usr.sbin/rdate/rdate.8 index aa1beb73eeb..f9052c2991e 100644 --- a/usr.sbin/rdate/rdate.8 +++ b/usr.sbin/rdate/rdate.8 @@ -1,4 +1,4 @@ -.\" $OpenBSD: rdate.8,v 1.16 2002/05/16 20:10:15 stevesk Exp $ +.\" $OpenBSD: rdate.8,v 1.17 2002/07/27 09:29:50 jakob Exp $ .\" $NetBSD: rdate.8,v 1.4 1996/04/08 20:55:17 jtc Exp $ .\" .\" Copyright (c) 1994 Christos Zoulas @@ -37,7 +37,7 @@ .Nd set the system's date from a remote host .Sh SYNOPSIS .Nm rdate -.Op Fl npsa +.Op Fl npsav .Ar host .Sh DESCRIPTION .Nm @@ -64,6 +64,8 @@ Use the .Xr adjtime 2 call to gradually skew the local time to the remote time rather than just hopping. +.It Fl v +Verbose output. .Sh FILES .Bl -tag -width /var/log/wtmp -compact .It Pa /var/log/wtmp diff --git a/usr.sbin/rdate/rdate.c b/usr.sbin/rdate/rdate.c index 115ec6c8120..241e4fd29fe 100644 --- a/usr.sbin/rdate/rdate.c +++ b/usr.sbin/rdate/rdate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rdate.c,v 1.15 2002/05/16 11:00:53 deraadt Exp $ */ +/* $OpenBSD: rdate.c,v 1.16 2002/07/27 09:29:50 jakob Exp $ */ /* $NetBSD: rdate.c,v 1.4 1996/03/16 12:37:45 pk Exp $ */ /* @@ -42,7 +42,7 @@ #if 0 from: static char rcsid[] = "$NetBSD: rdate.c,v 1.3 1996/02/22 06:59:18 thorpej Exp $"; #else -static const char rcsid[] = "$OpenBSD: rdate.c,v 1.15 2002/05/16 11:00:53 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: rdate.c,v 1.16 2002/07/27 09:29:50 jakob Exp $"; #endif #endif /* lint */ @@ -70,12 +70,13 @@ usage() (void) fprintf(stderr, " -p: just print, don't set\n"); (void) fprintf(stderr, " -s: just set, don't print\n"); (void) fprintf(stderr, " -a: use adjtime instead of instant change\n"); + (void) fprintf(stderr, " -v: verbose output\n"); } int main(int argc, char **argv) { - int pr = 0, silent = 0, ntp = 0; + int pr = 0, silent = 0, ntp = 0, verbose = 0; int slidetime = 0; char *hname; extern int optind; @@ -83,7 +84,7 @@ main(int argc, char **argv) struct timeval new, adjust; - while ((c = getopt(argc, argv, "psan")) != -1) + while ((c = getopt(argc, argv, "psanv")) != -1) switch (c) { case 'p': pr++; @@ -101,6 +102,10 @@ main(int argc, char **argv) ntp++; break; + case 'v': + verbose++; + break; + default: usage(); return 1; @@ -141,7 +146,7 @@ main(int argc, char **argv) adjsec = adjust.tv_sec + adjust.tv_usec / 1.0e6; - if (slidetime) { + if (slidetime || verbose) { if (ntp) (void) fprintf(stdout, "%s: adjust local clock by %.6f seconds\n", |