Skip to content

backports: Add a backport of g_closefrom(), g_fdwalk_set_cloexec()

Simon McVittie requested to merge wip/smcv/closefrom into master

These will be new API in GLib 2.79.2.

The only code change in the implementation, other than the _glnx wrappers, was to use close() instead of g_close (fd, NULL) in a context where it must be async-signal safe.

The test-case needed some more adjustments to be backwards-compatible with GLib from the distant past.

/cc @pwithnall @walters

Edited by Simon McVittie

Merge request reports