mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-05 02:36:19 +01:00
Merge branch 'spawn-close_range' into 'master'
gspawn: Use close_range() if available to close FDs between fork/exec See merge request GNOME/glib!1688
This commit is contained in:
commit
59b71837a5
@ -1327,6 +1327,11 @@ safe_closefrom (int lowfd)
|
|||||||
* simple wrapper of the fcntl command.
|
* simple wrapper of the fcntl command.
|
||||||
*/
|
*/
|
||||||
(void) fcntl (lowfd, F_CLOSEM);
|
(void) fcntl (lowfd, F_CLOSEM);
|
||||||
|
#elif defined(HAVE_CLOSE_RANGE)
|
||||||
|
/* close_range() is available in Linux since kernel 5.9, and on FreeBSD at
|
||||||
|
* around the same time. It was designed for use in async-signal-safe
|
||||||
|
* situations: https://bugs.python.org/issue38061 */
|
||||||
|
(void) close_range (lowfd, G_MAXUINT);
|
||||||
#else
|
#else
|
||||||
(void) safe_fdwalk (close_func, GINT_TO_POINTER (lowfd));
|
(void) safe_fdwalk (close_func, GINT_TO_POINTER (lowfd));
|
||||||
#endif
|
#endif
|
||||||
|
@ -473,6 +473,7 @@ if host_system == 'windows'
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
functions = [
|
functions = [
|
||||||
|
'close_range',
|
||||||
'endmntent',
|
'endmntent',
|
||||||
'endservent',
|
'endservent',
|
||||||
'fallocate',
|
'fallocate',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user