[Dnsmasq-discuss] dnsmasq --test > output to stderr

Ercolino de Spiacico bellocarico at hotmail.com
Thu Mar 24 09:03:43 UTC 2022


> The relevant code looks like:
> 
>   if (testmode)
>      {
>        fprintf(stderr, "dnsmasq: %s.\n", _("syntax check OK"));
>        exit(0);
>      }
> 
> So it's not an accident, but the reason it's like that is rather lost in 
> the mists of time.
> 
> Can you take advantage of the fact that the exit code is zero when the 
> test passes, but non-zero if there's an error?

My ideal scenario would be to suppress the OK and print out any 
descriptive error (whatever dnsmasq tells me), so it's not just it 
worked or it didn't. I can try to use the exit code but I can only think 
of very clumsy ways to extract error messages only...


Out of curiosity is there an interest in correcting this the OK message 
to stdout?

Thanks






More information about the Dnsmasq-discuss mailing list