X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=gui.c;h=01cca6e6d08eac45ae3fbf63b999d453e40e14e3;hb=5ebdf3a92f55c582f7b23236b4b403faa76f1f19;hp=15422b96bc94a5c82fd29e93a11df7c4317c2e1c;hpb=31233289bedbb596b98eadd411bc6aac54d4ed69;p=paraslash.git diff --git a/gui.c b/gui.c index 15422b96..01cca6e6 100644 --- a/gui.c +++ b/gui.c @@ -521,13 +521,12 @@ static void setup_signal_handling(void) para_install_sighandler(SIGCHLD); para_install_sighandler(SIGWINCH); para_install_sighandler(SIGUSR1); -// signal(SIGPIPE, SIG_IGN); - signal(SIGHUP, SIG_IGN); + para_sigaction(SIGHUP, SIG_IGN); } __noreturn static void do_exit(int ret) { - signal(SIGTERM, SIG_IGN); + para_sigaction(SIGTERM, SIG_IGN); kill(0, SIGTERM); exit(ret); } @@ -881,7 +880,13 @@ static int open_audiod_pipe(void) if (init) init = 0; else - sleep(1); + /* + * Sleep a bit to avoid a busy loop. As the call to sleep() may + * be interrupted by SIGCHLD, we simply wait until the call + * succeeds. + */ + while (sleep(2)) + ; /* nothing */ return para_open_audiod_pipe(conf.stat_cmd_arg); }