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

2022-03-24 Thread Simon Kelley
On 24/03/2022 09:03, Ercolino de Spiacico wrote: 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 t

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

2022-03-24 Thread Ercolino de Spiacico
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

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

2022-03-23 Thread Simon Kelley
On 23/03/2022 21:02, Ercolino de Spiacico wrote: It seems like "dnsmasq --test" redirects the output "syntax check OK" message to stderr (2) by default: root@sparrow:/tmp# dnsmasq --test dnsmasq: syntax check OK. root@sparrow:/tmp# dnsmasq --test 1>/dev/null dnsmasq: syntax check OK. root@s

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

2022-03-23 Thread Ercolino de Spiacico
It seems like "dnsmasq --test" redirects the output "syntax check OK" message to stderr (2) by default: root@sparrow:/tmp# dnsmasq --test dnsmasq: syntax check OK. root@sparrow:/tmp# dnsmasq --test 1>/dev/null dnsmasq: syntax check OK. root@sparrow:/tmp# dnsmasq --test 2>/dev/null root@sparrow: