NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
bin/53813: ntpdate should print usage if not provided a server on commandline
>Number: 53813
>Category: bin
>Synopsis: ntpdate should print usage if not provided a server on commandline
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: bin-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Dec 26 06:30:00 +0000 2018
>Originator: Edgar Pettijohn
>Release: 8.0 Wed Dec 26 00:21:57 CST 2018
>Organization:
>Environment:
NetBSD netbsd.my.domain 8.0 NetBSD 8.0 (GENERIC) #0: Tue Jul 17 14:59:51 UTC 2018 mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/amd64/compile/GENERIC amd64
>Description:
If you start ntpdate without any arguments you get this helpful text:
ntpdate[23355]: no servers can be used, exiting
If provided with the "usage" text it would be easier for the user to discover their mistake.
>How-To-Repeat:
# ntpdate
>Fix:
Print the usage text instead.
Index: ntpdate.c
===================================================================
RCS file: /cvsroot/src/external/bsd/ntp/dist/ntpdate/ntpdate.c,v
retrieving revision 1.11
diff -u -r1.11 ntpdate.c
--- ntpdate.c 13 Apr 2017 20:17:42 -0000 1.11
+++ ntpdate.c 26 Dec 2018 06:16:56 -0000
@@ -432,7 +432,7 @@
break;
}
- if (errflg) {
+ if (errflg || sys_numservers == 0) {
(void) fprintf(stderr,
"usage: %s [-46bBdqsuv] [-a key#] [-e delay] [-k file] [-p samples] [-o version#] [-t timeo] server ...\n",
progname);
@@ -499,11 +499,6 @@
}
#endif
- if (sys_numservers == 0) {
- msyslog(LOG_ERR, "no servers can be used, exiting");
- exit(1);
- }
-
/*
* Initialize the time of day routines and the I/O subsystem
*/
Home |
Main Index |
Thread Index |
Old Index