From 6c20e8393eba4a9f330143b2158e28ea594cbadd Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Mon, 31 Oct 2022 11:07:57 +0900 Subject: spawn: Fix spawn_cb of gpgrt_spawn_process_fd. * src/gpg-error.def.in (gpgrt_close_all_fds): New. * src/gpg-error.vers (gpgrt_close_all_fds): New. * src/gpg-error.h.in (GPGRT_SPAWN_INHERIT_FILE): New. (gpgrt_spawn_process_fd): SPAWN_CB having return value. * src/gpgrt-int.h (_gpgrt_spawn_process_fd): SPAWN_CB change. * src/spawn-posix.c (_gpgrt_close_all_fds): Rename from close_all_fds, and export it. (do_exec): Support the case not closing fds. (_gpgrt_spawn_process_fd): Handle return value of SPAWN_CB to determine closing all fds or not. * src/spawn-w32.c (_gpgrt_spawn_process_fd): Run SPAWN_CB. (_gpgrt_close_all_fds): New. * src/visibility.c (gpgrt_close_all_fds): New. * src/visibility.h (gpgrt_close_all_fds): New. -- Now, we have the API of gpgrt_spawn_process_fd for POSIX and Windows. Giving portable semantics for spawning a process is difficult, and it is still difficult for users to writing a function for SPAWN_CB with portability, but gpgrt_spawn_process_fd gives the feature of spawning a process. GnuPG-bug-id: 6249 Signed-off-by: NIIBE Yutaka --- src/gpg-error.def.in | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gpg-error.def.in') diff --git a/src/gpg-error.def.in b/src/gpg-error.def.in index ac8f2f6..f94c6f4 100644 --- a/src/gpg-error.def.in +++ b/src/gpg-error.def.in @@ -242,4 +242,6 @@ EXPORTS gpgrt_utf8_to_wchar @186 gpgrt_wchar_to_utf8 @187 + gpgrt_close_all_fds @188 + ;; end of file with public symbols for Windows. -- cgit v1.2.3