Home GnuPG

spawn:posix: Add an improvement when closefrom is not available.

Description

spawn:posix: Add an improvement when closefrom is not available.

* src/gpgrt-int.h (_gpgrt_close_all_fds): Fix function declaration.
* src/spawn-posix.c (USE_GET_MAX_FDS): Define when closefrom is not
available.
(get_max_fds): Add an argument of FALLBACK_MAX_FDS.
(_gpgrt_close_all_fds, my_exec, spawn_detached): Likewise.
(_gpgrt_process_spawn): [USE_GET_MAX_FDS && _SC_OPEN_MAX]: It's a
parent process which calls sysconf.
  • GnuPG-bug-id: T7696
  • Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>

Details

Provenance
gniibeAuthored on Thu, Jun 26, 4:37 AM
Parents
rE9cc016c38df1: posix:spawn: Use getdents64 when closefrom is not available.
Branches
Unknown
Tags
Unknown
Tasks
T7696: POSIX: spawn fixes