aboutsummaryrefslogtreecommitdiffstats
path: root/src/system-posix.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2023-05-25 04:49:09 +0000
committerNIIBE Yutaka <[email protected]>2023-05-25 05:01:09 +0000
commit3bccb33ccd9028ff505d9979fd6c8a37393b892d (patch)
treeff36c2065b3e2fe11738d9068fdcbf012b814069 /src/system-posix.c
parentAllow use of global system hooks with API version 2. (diff)
downloadlibassuan-gniibe/t6487.tar.gz
libassuan-gniibe/t6487.zip
Add new pipe functions to control its server process.gniibe/t6487
* src/assuan-pipe-connect.c (assuan_pipe_wait_server_termination) (assuan_pipe_kill_server): New. * src/assuan.h.in: Add new functions. * src/libassuan.def: Add symbols for those functions. * src/libassuan.vers: Likewise. * src/system-posix.c (__assuan_waitpid): Extend the semantics for OPTIONS. * src/system-w32.c (__assuan_waitpid): Likewise. -- GnuPG-bug-id: 6487 Signed-off-by: NIIBE Yutaka <[email protected]>
Diffstat (limited to 'src/system-posix.c')
-rw-r--r--src/system-posix.c7
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);
}