aboutsummaryrefslogtreecommitdiffstats
path: root/src/system-posix.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <[email protected]>2023-07-24 05:55:09 +0000
committerNIIBE Yutaka <[email protected]>2023-07-24 05:55:09 +0000
commitbf25d0e39bdcff28dc690722b8defc21bebeeed3 (patch)
tree1bbf55097376da0b6efb77cf83da16683188994a /src/system-posix.c
parentsocket: Don't call pre/post_syscall for bind. (diff)
downloadlibassuan-bf25d0e39bdcff28dc690722b8defc21bebeeed3.tar.gz
libassuan-bf25d0e39bdcff28dc690722b8defc21bebeeed3.zip
Add new pipe functions to control its server process.
* 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: T6487 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);
}