diff options
Diffstat (limited to 'src/system-posix.c')
-rw-r--r-- | src/system-posix.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/system-posix.c b/src/system-posix.c index 5f3a7f2..7952907 100644 --- a/src/system-posix.c +++ b/src/system-posix.c @@ -398,12 +398,13 @@ assuan_pid_t __assuan_waitpid (assuan_context_t ctx, assuan_pid_t pid, int nowait, int *status, int options) { + if (nowait) + return 0; + /* We can't just release the PID, a waitpid is mandatory. But NOWAIT in POSIX systems just means the caller already did the waitpid for this child. */ - if (! nowait) - return waitpid (pid, NULL, 0); - return 0; + return waitpid (pid, status, options ? WNOHANG : 0); } |