]> git.tue.mpg.de Git - paraslash.git/commitdiff
Merge branch 'maint'
authorAndre Noll <maan@systemlinux.org>
Sun, 6 Jun 2010 16:35:47 +0000 (18:35 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 6 Jun 2010 16:35:47 +0000 (18:35 +0200)
Conflicts:
gui.c

1  2 
gui.c

diff --cc gui.c
index fa1538b0d63f3db2ca8be6497aa0ce797d3a89a1,01cca6e6d08eac45ae3fbf63b999d453e40e14e3..dbe0a19ced1d1da9e2d588a2498dfc931371ee65
--- 1/gui.c
--- 2/gui.c
+++ b/gui.c
@@@ -902,15 -880,14 +902,21 @@@ 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 */
 -      return para_open_audiod_pipe(conf.stat_cmd_arg);
 +      ret = para_exec_cmdline_pid(&pid, conf.stat_cmd_arg, fds);
 +      if (ret < 0)
 +              return ret;
 +      ret = mark_fd_nonblocking(fds[1]);
 +      if (ret >= 0)
 +              return fds[1];
 +      close(fds[1]);
 +      return ret;
  }
  
  /*