From bf25d0e39bdcff28dc690722b8defc21bebeeed3 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Mon, 24 Jul 2023 14:55:09 +0900 Subject: 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 --- src/system-posix.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/system-posix.c') 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); } -- cgit v1.2.3