CVS commit: src/usr.sbin/rdate
Module Name:src Committed By: ginsbach Date: Sat Aug 26 18:16:06 UTC 2017 Modified Files: src/usr.sbin/rdate: rdate.8 rdate.c Log Message: Sort options alphabetically. To generate a diff of this commit: cvs rdiff -u -r1.11 -r1.12 src/usr.sbin/rdate/rdate.8 cvs rdiff -u -r1.20 -r1.21 src/usr.sbin/rdate/rdate.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/rdate/rdate.8 diff -u src/usr.sbin/rdate/rdate.8:1.11 src/usr.sbin/rdate/rdate.8:1.12 --- src/usr.sbin/rdate/rdate.8:1.11 Wed Oct 21 01:07:47 2009 +++ src/usr.sbin/rdate/rdate.8 Sat Aug 26 18:16:05 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: rdate.8,v 1.11 2009/10/21 01:07:47 snj Exp $ +.\" $NetBSD: rdate.8,v 1.12 2017/08/26 18:16:05 ginsbach Exp $ .\" .\" Copyright (c) 1994 Christos Zoulas .\" All rights reserved. @@ -31,7 +31,7 @@ .Nd set the system's date from a remote host .Sh SYNOPSIS .Nm -.Op Fl psa +.Op Fl aps .Ar host .Sh DESCRIPTION .Nm @@ -43,15 +43,15 @@ protocol which is usually implemented as Available options: .Pp .Bl -tag -width indent -.It Fl p -Do not set, just print the remote time -.It Fl s -Do not print the time. .It Fl a Use the .Xr adjtime 2 call to gradually skew the local time to the remote time rather than just hopping. +.It Fl p +Do not set, just print the remote time +.It Fl s +Do not print the time. .El .Sh FILES .Bl -tag -width /var/log/wtmp -compact Index: src/usr.sbin/rdate/rdate.c diff -u src/usr.sbin/rdate/rdate.c:1.20 src/usr.sbin/rdate/rdate.c:1.21 --- src/usr.sbin/rdate/rdate.c:1.20 Thu May 4 16:26:09 2017 +++ src/usr.sbin/rdate/rdate.c Sat Aug 26 18:16:05 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: rdate.c,v 1.20 2017/05/04 16:26:09 sevan Exp $ */ +/* $NetBSD: rdate.c,v 1.21 2017/08/26 18:16:05 ginsbach Exp $ */ /* * Copyright (c) 1994 Christos Zoulas @@ -34,7 +34,7 @@ */ #include #ifndef lint -__RCSID("$NetBSD: rdate.c,v 1.20 2017/05/04 16:26:09 sevan Exp $"); +__RCSID("$NetBSD: rdate.c,v 1.21 2017/08/26 18:16:05 ginsbach Exp $"); #endif /* lint */ #include @@ -59,10 +59,10 @@ static void usage(void); static void usage(void) { - (void) fprintf(stderr, "usage: %s [-psa] host\n", getprogname()); + (void) fprintf(stderr, "usage: %s [-aps] host\n", getprogname()); + (void) fprintf(stderr, " -a: use adjtime instead of instant change\n"); (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"); } int
CVS commit: src/usr.sbin/rdate
Module Name:src Committed By: ginsbach Date: Sat Aug 26 19:26:32 UTC 2017 Modified Files: src/usr.sbin/rdate: rdate.8 rdate.c Log Message: Support -4 and -6. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/usr.sbin/rdate/rdate.8 cvs rdiff -u -r1.21 -r1.22 src/usr.sbin/rdate/rdate.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/rdate/rdate.8 diff -u src/usr.sbin/rdate/rdate.8:1.12 src/usr.sbin/rdate/rdate.8:1.13 --- src/usr.sbin/rdate/rdate.8:1.12 Sat Aug 26 18:16:05 2017 +++ src/usr.sbin/rdate/rdate.8 Sat Aug 26 19:26:32 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: rdate.8,v 1.12 2017/08/26 18:16:05 ginsbach Exp $ +.\" $NetBSD: rdate.8,v 1.13 2017/08/26 19:26:32 ginsbach Exp $ .\" .\" Copyright (c) 1994 Christos Zoulas .\" All rights reserved. @@ -23,7 +23,7 @@ .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" -.Dd April 30, 1994 +.Dd August 26, 2017 .Dt RDATE 8 .Os .Sh NAME @@ -31,7 +31,7 @@ .Nd set the system's date from a remote host .Sh SYNOPSIS .Nm -.Op Fl aps +.Op Fl 46aps .Ar host .Sh DESCRIPTION .Nm @@ -43,6 +43,14 @@ protocol which is usually implemented as Available options: .Pp .Bl -tag -width indent +.It Fl 4 +Forces +.Nm +to use IPv4 addresses only. +.It Fl 6 +Forces +.Nm +to use IPv6 addresses only. .It Fl a Use the .Xr adjtime 2 Index: src/usr.sbin/rdate/rdate.c diff -u src/usr.sbin/rdate/rdate.c:1.21 src/usr.sbin/rdate/rdate.c:1.22 --- src/usr.sbin/rdate/rdate.c:1.21 Sat Aug 26 18:16:05 2017 +++ src/usr.sbin/rdate/rdate.c Sat Aug 26 19:26:32 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: rdate.c,v 1.21 2017/08/26 18:16:05 ginsbach Exp $ */ +/* $NetBSD: rdate.c,v 1.22 2017/08/26 19:26:32 ginsbach Exp $ */ /* * Copyright (c) 1994 Christos Zoulas @@ -34,7 +34,7 @@ */ #include #ifndef lint -__RCSID("$NetBSD: rdate.c,v 1.21 2017/08/26 18:16:05 ginsbach Exp $"); +__RCSID("$NetBSD: rdate.c,v 1.22 2017/08/26 19:26:32 ginsbach Exp $"); #endif /* lint */ #include @@ -59,7 +59,9 @@ static void usage(void); static void usage(void) { - (void) fprintf(stderr, "usage: %s [-aps] host\n", getprogname()); + (void) fprintf(stderr, "usage: %s [-46aps] host\n", getprogname()); + (void) fprintf(stderr, " -4: use IPv4 addresses only\n"); + (void) fprintf(stderr, " -6: use IPv6 addresses only\n"); (void) fprintf(stderr, " -a: use adjtime instead of instant change\n"); (void) fprintf(stderr, " -p: just print, don't set\n"); (void) fprintf(stderr, " -s: just set, don't print\n"); @@ -78,22 +80,31 @@ main(int argc, char *argv[]) struct addrinfo hints, *res, *res0; int c; int error; + int family = AF_UNSPEC; adjustment = 0; - while ((c = getopt(argc, argv, "psa")) != -1) + while ((c = getopt(argc, argv, "46aps")) != -1) switch (c) { - case 'p': - pr++; + case '4': + family = AF_INET; break; - case 's': - silent++; + case '6': + family = AF_INET6; break; case 'a': slidetime++; break; + case 'p': + pr++; + break; + + case 's': + silent++; + break; + default: usage(); return 1; @@ -106,7 +117,7 @@ main(int argc, char *argv[]) hname = argv[optind]; memset(&hints, 0, sizeof (hints)); - hints.ai_family = PF_UNSPEC; + hints.ai_family = family; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_CANONNAME; error = getaddrinfo(hname, "time", &hints, &res0);
CVS commit: src/usr.sbin/rdate
Module Name:src Committed By: wiz Date: Sun Aug 27 20:45:47 UTC 2017 Modified Files: src/usr.sbin/rdate: rdate.8 Log Message: New sentence, new line. Remove superfluous Pp. To generate a diff of this commit: cvs rdiff -u -r1.13 -r1.14 src/usr.sbin/rdate/rdate.8 Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Modified files: Index: src/usr.sbin/rdate/rdate.8 diff -u src/usr.sbin/rdate/rdate.8:1.13 src/usr.sbin/rdate/rdate.8:1.14 --- src/usr.sbin/rdate/rdate.8:1.13 Sat Aug 26 19:26:32 2017 +++ src/usr.sbin/rdate/rdate.8 Sun Aug 27 20:45:47 2017 @@ -1,4 +1,4 @@ -.\" $NetBSD: rdate.8,v 1.13 2017/08/26 19:26:32 ginsbach Exp $ +.\" $NetBSD: rdate.8,v 1.14 2017/08/27 20:45:47 wiz Exp $ .\" .\" Copyright (c) 1994 Christos Zoulas .\" All rights reserved. @@ -36,12 +36,12 @@ .Sh DESCRIPTION .Nm displays and sets the local date and time from the -host name or address given as the argument. It uses the RFC 868 -protocol which is usually implemented as a built-in service of +host name or address given as the argument. +It uses the RFC 868 protocol which is usually implemented as a +built-in service of .Xr inetd 8 . .Pp Available options: -.Pp .Bl -tag -width indent .It Fl 4 Forces