NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/53813: ntpdate should print usage if not provided a server on commandline



On Wed, Dec 26, 2018 at 04:00:02PM +0000, Christos Zoulas wrote:
> The following reply was made to PR bin/53813; it has been noted by GNATS.
> 
> From: christos%zoulas.com@localhost (Christos Zoulas)
> To: gnats-bugs%NetBSD.org@localhost, gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost
> Cc: 
> Subject: Re: bin/53813: ntpdate should print usage if not provided a server on commandline
> Date: Wed, 26 Dec 2018 10:57:36 -0500
> 
>  On Dec 26,  6:30am, edgar%pettijohn-web.com@localhost (edgar%pettijohn-web.com@localhost) wrote:
>  -- Subject: bin/53813: ntpdate should print usage if not provided a server on
>  
>  Have you tested this? Moving the check before adding the servers will
>  always fail...
>  
>  christos
>

sorry. Perhaps this or similar is better:

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 16:24:54 -0000
@@ -431,8 +431,7 @@
                default:
                        break;
            }
-
-       if (errflg) {
+       if (errflg || argc == 1) {
                (void) fprintf(stderr,
                    "usage: %s [-46bBdqsuv] [-a key#] [-e delay] [-k file] [-p samples] [-o version#] [-t timeo] server ...\n",
                    progname);
  



Home | Main Index | Thread Index | Old Index