]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
Initialize dns process before opening display 157/head
authorNarthorn <narthorn@gmail.com>
Sat, 8 Oct 2016 06:38:10 +0000 (08:38 +0200)
committerNarthorn <narthorn@gmail.com>
Sat, 8 Oct 2016 06:38:10 +0000 (08:38 +0200)
By opening the display before the dns process is forked, the child
inherits things like ncurses's handler for SIGWINCH (window resize
event), which can cause it to crash and leave the parent process in
an infinite select() loop, freezing the display.

mtr.c

diff --git a/mtr.c b/mtr.c
index 377283c93bc16e1def572d5fc31d049a31fc542d..0acb6583bbb9c007816f3852c42a8d7ec8c89b12 100644 (file)
--- a/mtr.c
+++ b/mtr.c
@@ -786,8 +786,8 @@ extern int main(int argc, char **argv)
 
 
     lock(stdout);
-      display_open(&ctl);
       dns_open(&ctl);
+      display_open(&ctl);
 
       display_loop(&ctl);