diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-10-11 19:33:21 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-10-11 19:33:21 +0000 |
commit | 597a60e8db27dbfbabe5419e2d45d0c8d13a5a93 (patch) | |
tree | 35d6be736e2cd3f649648cfb5f5f719dba28af95 /usr.sbin/ntpd | |
parent | 64def550535aa9682d2c75c98e2b63ccf71c971c (diff) |
improve ntpctl argv parsing
Diffstat (limited to 'usr.sbin/ntpd')
-rw-r--r-- | usr.sbin/ntpd/ntpd.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/ntpd/ntpd.c b/usr.sbin/ntpd/ntpd.c index 4b7df5f97e0..a9660de905c 100644 --- a/usr.sbin/ntpd/ntpd.c +++ b/usr.sbin/ntpd/ntpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.c,v 1.72 2013/10/09 12:34:12 deraadt Exp $ */ +/* $OpenBSD: ntpd.c,v 1.73 2013/10/11 19:33:20 deraadt Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -81,7 +81,7 @@ usage(void) extern char *__progname; if (strcmp(__progname, "ntpctl") == 0) - fprintf(stderr, "usage: ntpctl [-s modifier]\n"); + fprintf(stderr, "usage: ntpctl [-s all|peers|sensors|status]\n"); else fprintf(stderr, "usage: %s [-dnSsv] [-f file]\n", __progname); @@ -556,9 +556,8 @@ ctl_main(int argc, char *argv[]) usage(); /* NOTREACHED */ } - } - else - errx (1, "invalid do_what"); + } else + usage(); if ((fd = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) err(1, "ntpctl: socket"); |