projects
/
gnulib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
72a9261
)
Try to fix waitid() based code.
author
Bruno Haible
<bruno@clisp.org>
Tue, 10 Jun 2008 11:55:34 +0000
(13:55 +0200)
committer
Bruno Haible
<bruno@clisp.org>
Tue, 10 Jun 2008 11:55:34 +0000
(13:55 +0200)
ChangeLog
patch
|
blob
|
history
lib/wait-process.c
patch
|
blob
|
history
diff --git
a/ChangeLog
b/ChangeLog
index
97aec20
..
585e59e
100644
(file)
--- a/
ChangeLog
+++ b/
ChangeLog
@@
-1,5
+1,9
@@
2008-06-10 Bruno Haible <bruno@clisp.org>
2008-06-10 Bruno Haible <bruno@clisp.org>
+ * lib/wait-process.c (wait_subprocess): Try to fix waitid() based code.
+
+2008-06-10 Bruno Haible <bruno@clisp.org>
+
* tests/test-memmem.c (main): Reset SIGALRM to default handling before
using alarm().
* tests/test-strcasestr.c (main): Likewise.
* tests/test-memmem.c (main): Reset SIGALRM to default handling before
using alarm().
* tests/test-strcasestr.c (main): Likewise.
diff --git
a/lib/wait-process.c
b/lib/wait-process.c
index
97bc57f
..
e3086b4
100644
(file)
--- a/
lib/wait-process.c
+++ b/
lib/wait-process.c
@@
-253,9
+253,9
@@
wait_subprocess (pid_t child, const char *progname,
bool slave_process, bool exit_on_error)
{
#if HAVE_WAITID && defined WNOWAIT && 0
bool slave_process, bool exit_on_error)
{
#if HAVE_WAITID && defined WNOWAIT && 0
- /* Commented out because waitid() with
WNOWAIT doesn't work: On Solaris 7
- and OSF/1 4.0, it returns -1 and sets errno = ECHILD, and on HP-UX 10.20
- it just hangs. */
+ /* Commented out because waitid() with
out WEXITED and with WNOWAIT doesn't
+ work: On Solaris 7 and OSF/1 4.0, it returns -1 and sets errno = ECHILD,
+
and on HP-UX 10.20
it just hangs. */
/* Use of waitid() with WNOWAIT avoids a race condition: If slave_process is
true, and this process sleeps a very long time between the return from
waitpid() and the execution of unregister_slave_subprocess(), and
/* Use of waitid() with WNOWAIT avoids a race condition: If slave_process is
true, and this process sleeps a very long time between the return from
waitpid() and the execution of unregister_slave_subprocess(), and
@@
-265,7
+265,8
@@
wait_subprocess (pid_t child, const char *progname,
siginfo_t info;
for (;;)
{
siginfo_t info;
for (;;)
{
- if (waitid (P_PID, child, &info, slave_process ? WNOWAIT : 0) < 0)
+ if (waitid (P_PID, child, &info, WEXITED | (slave_process ? WNOWAIT : 0))
+ < 0)
{
# ifdef EINTR
if (errno == EINTR)
{
# ifdef EINTR
if (errno == EINTR)
@@
-297,7
+298,7
@@
wait_subprocess (pid_t child, const char *progname,
/* Now remove the zombie from the process list. */
for (;;)
{
/* Now remove the zombie from the process list. */
for (;;)
{
- if (waitid (P_PID, child, &info,
0
) < 0)
+ if (waitid (P_PID, child, &info,
WEXITED
) < 0)
{
# ifdef EINTR
if (errno == EINTR)
{
# ifdef EINTR
if (errno == EINTR)