On 08/30/15 14:58, Michael Reed wrote:
> Hi all,
> 
> If ntpd is run with the -n flag, and /etc/ntpd.conf is parsed without
> error, then "Configuration OK" is printed.  I don't think this is
> particularly useful, as both a lack of an error message and an exit
> value of 0 already indicate success in this case.  This seems to be the
> case for most (many?) programs in the base system, such as doas(1).
> 
> Given that, I've removed the message
> 
> Regards,
> Michael
> 
> 
> 
> Index: ntpd.c
> ===================================================================
> RCS file: /cvs/src/usr.sbin/ntpd/ntpd.c,v
> retrieving revision 1.94
> diff -u -p -r1.94 ntpd.c
> --- ntpd.c    18 Jul 2015 00:53:44 -0000      1.94
> +++ ntpd.c    30 Aug 2015 18:42:06 -0000
> @@ -159,7 +159,6 @@ main(int argc, char *argv[])
>               exit(1);
>  
>       if (lconf.noaction) {
> -             fprintf(stderr, "configuration OK\n");
>               exit(0);
>       }
>  
> 

In case this idea is accepted, here's an updated patch which does
the same for radiusd(8).


Index: src/usr.sbin/ntpd/ntpd.c
===================================================================
RCS file: /cvs/src/usr.sbin/ntpd/ntpd.c,v
retrieving revision 1.94
diff -u -p -r1.94 ntpd.c
--- src/usr.sbin/ntpd/ntpd.c    18 Jul 2015 00:53:44 -0000      1.94
+++ src/usr.sbin/ntpd/ntpd.c    30 Aug 2015 21:57:53 -0000
@@ -159,7 +159,6 @@ main(int argc, char *argv[])
                exit(1);
 
        if (lconf.noaction) {
-               fprintf(stderr, "configuration OK\n");
                exit(0);
        }
 
Index: src/usr.sbin/radiusd/radiusd.c
===================================================================
RCS file: /cvs/src/usr.sbin/radiusd/radiusd.c,v
retrieving revision 1.7
diff -u -p -r1.7 radiusd.c
--- src/usr.sbin/radiusd/radiusd.c      25 Aug 2015 01:12:59 -0000      1.7
+++ src/usr.sbin/radiusd/radiusd.c      30 Aug 2015 21:57:53 -0000
@@ -142,7 +142,6 @@ main(int argc, char *argv[])
        if (parse_config(conffile, radiusd) != 0)
                errx(EX_DATAERR, "config error");
        if (noaction) {
-               fprintf(stderr, "configuration OK\n");
                exit(EXIT_SUCCESS);
        }
 

Reply via email to