traviscross / mtr

Official repository for mtr, a network diagnostic tool
http://www.bitwizard.nl/mtr/
GNU General Public License v2.0
2.64k stars 337 forks source link

ui: make interactive and non-interactive exit code the same #447

Closed kerolasa closed 2 years ago

kerolasa commented 2 years ago

Before this change the report gave successful exit value when destination hostname could not be found.

$ ./mtr --report nxdomain. ; echo $?
./mtr: Failed to resolve host: nxdomain.: Name or service not known
0

Quickly looking 'git grep ---after-context if.*Interactive' there does not appear to be more than the two instances in main() where exit is called depending on interactive, so this change should cover all these cases.

Reported-by: Marek Kroemeke mkroemeke@cloudflare.com Signed-off-by: Sami Kerola kerolasa@iki.fi