From 5ad97e8fa62882b2014a67b4e57dab3b37ccaf4c Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Thu, 20 Oct 2022 14:23:20 +0900 Subject: gpgrt_spawn_process, gpgrt_spawn_process_fd: Change the API. * src/gpg-error.h.in (gpgrt_spawn_process): Remove PREEXEC argument. (gpgrt_spawn_process_fd): Add AFTER_FORK_CB and AFTER_FORK_CB_ARG. * src/gpgrt-int.h (_gpgrt_spawn_process): Remove PREEXEC argument. (_gpgrt_spawn_process_fd): Add AFTER_FORK_CB and AFTER_FORK_CB_ARG. * src/spawn-posix.c (do_exec): Remove PREEXEC argument. (_gpgrt_spawn_process): Remove PREEXEC argument. (_gpgrt_spawn_process_fd): Add AFTER_FORK_CB and AFTER_FORK_CB_ARG. (_gpgrt_spawn_process_detached): Follow the change of do_exec. * src/spawn-w32.c (_gpgrt_spawn_process): Remove PREEXEC argument. (_gpgrt_spawn_process_fd): Add AFTER_FORK_CB and AFTER_FORK_CB_ARG. * src/visibility.c (gpgrt_spawn_process): Remove PREEXEC argument. (gpgrt_spawn_process_fd): Add AFTER_FORK_CB and AFTER_FORK_CB_ARG. -- GnuPG-bug-id: 6249 Signed-off-by: NIIBE Yutaka --- src/gpg-error.h.in | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gpg-error.h.in') diff --git a/src/gpg-error.h.in b/src/gpg-error.h.in index 161a3ad..aca7243 100644 --- a/src/gpg-error.h.in +++ b/src/gpg-error.h.in @@ -1103,8 +1103,7 @@ gpg_err_code_t gpgrt_make_pipe (int filedes[2], gpgrt_stream_t *r_fp, /* Fork and exec PGMNAME. */ gpg_err_code_t gpgrt_spawn_process (const char *pgmname, const char *argv[], - int *execpt, void (*preexec)(void), - unsigned int flags, + int *execpt, unsigned int flags, gpgrt_stream_t *r_infp, gpgrt_stream_t *r_outfp, gpgrt_stream_t *r_errfp, @@ -1113,6 +1112,8 @@ gpg_err_code_t gpgrt_spawn_process (const char *pgmname, const char *argv[], /* Fork and exec PGNNAME and connect the process to the given FDs. */ gpg_err_code_t gpgrt_spawn_process_fd (const char *pgmname, const char *argv[], int infd, int outfd, int errfd, + void (*after_fork_cb)(void *), + void *after_fork_cb_arg, pid_t *pid); /* Fork and exec PGMNAME as a detached process. */ -- cgit v1.2.3