Home GnuPG

Cleaner semantics for _gpgrt_process_spawn without a callback.

Description

Cleaner semantics for _gpgrt_process_spawn without a callback.

* src/gpg-error.h.in (@define:struct_spawn_cb_arg@): Remove.
(gpgrt_spawn_actions_t): New.
(@define:spawn_actions_functions@): New.
* src/gpgrt-int.h (_gpgrt_spawn_actions_new)
(_gpgrt_spawn_actions_release, _gpgrt_spawn_actions_set_envvars)
(_gpgrt_spawn_actions_set_redirect): New.
[HAVE_W32_SYSTEM] (_gpgrt_spawn_actions_set_inherit_handles): New.
[!HAVE_W32_SYSTEM] (_gpgrt_spawn_actions_set_inherit_fds)
(_gpgrt_spawn_actions_set_atfork): New.
(_gpgrt_process_spawn): Use gpgrt_spawn_actions_t.
(_gpgrt_spawn_helper): Remove.
* src/mkheader.c: Emit gpgrt_spawn_actions_* definition.
* src/spawn-posix.c(_gpgrt_spawn_actions_new)
(_gpgrt_spawn_actions_release, _gpgrt_spawn_actions_set_envvars)
(_gpgrt_spawn_actions_set_redirect)
(_gpgrt_spawn_actions_set_inherit_fds)
(_gpgrt_spawn_actions_set_atfork): New.
(spawn_detached, _gpgrt_process_spawn): Use gpgrt_spawn_actions_t.
(_gpgrt_spawn_helper): Remove.
* src/spawn-w32.c: Ditto, with
_gpgrt_spawn_actions_set_inherit_handles, but no
_gpgrt_spawn_actions_set_atfork.
  • GnuPG-bug-id: T6249
  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

Details

Provenance
gniibeAuthored on May 29 2024, 8:14 AM
Parents
rE8dc6e3281e17: Import spawn functions from GnuPG master.
Branches
Unknown
Tags
Unknown
Tasks
T6249: gpgrt: spawn functions