X-Git-Url: http://git.hungrycats.org/cgi-bin/gitweb.cgi?p=xscreensaver;a=blobdiff_plain;f=driver%2Fsubprocs.c;h=0ccf7d2367bdb2d680221d4e628411b9b4a83694;hp=29ad60092daf40880afdae6d1acb064b122ec48f;hb=d6b0217f2417bd19187f0ebc389d6c5c2233b11c;hpb=aa75c7476aeaa84cf3abc192b376a8b03c325213 diff --git a/driver/subprocs.c b/driver/subprocs.c index 29ad6009..0ccf7d23 100644 --- a/driver/subprocs.c +++ b/driver/subprocs.c @@ -44,6 +44,7 @@ #endif /* VMS */ #include /* for the signal names */ +#include #if !defined(SIGCHLD) && defined(SIGCLD) # define SIGCHLD SIGCLD @@ -1303,6 +1304,7 @@ get_best_gl_visual (saver_info *si, Screen *screen) { int result = 0; int wait_status = 0; + pid_t pid = -1; FILE *f = fdopen (in, "r"); unsigned long v = 0; @@ -1321,8 +1323,17 @@ get_best_gl_visual (saver_info *si, Screen *screen) close (errin); } - /* Wait for the child to die. */ - waitpid (-1, &wait_status, 0); + /* Wait for the child to die - wait for this pid only, not others. */ + pid = waitpid (forked, &wait_status, 0); + if (si->prefs.debug_p) + { + write_string (STDERR_FILENO, blurb()); + write_string (STDERR_FILENO, ": waitpid("); + write_long (STDERR_FILENO, (long) forked); + write_string (STDERR_FILENO, ") ==> "); + write_long (STDERR_FILENO, (long) pid); + write_string (STDERR_FILENO, "\n"); + } unblock_sigchld(); /* child is dead and waited, unblock now. */