X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;ds=sidebyside;f=gui.c;h=dbe0a19ced1d1da9e2d588a2498dfc931371ee65;hb=e67116354084dcf587c03dccaeb18d8cee886c1b;hp=fa1538b0d63f3db2ca8be6497aa0ce797d3a89a1;hpb=60ef885705932a682097ad2b9f2379282d814e79;p=paraslash.git diff --git a/gui.c b/gui.c index fa1538b0..dbe0a19c 100644 --- a/gui.c +++ b/gui.c @@ -902,7 +902,13 @@ static int open_stat_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 */ ret = para_exec_cmdline_pid(&pid, conf.stat_cmd_arg, fds); if (ret < 0) return ret;