diff options
author | Christian Persch <chpe@src.gnome.org> | 2022-02-28 17:37:43 +0100 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2022-02-28 17:59:05 +0100 |
commit | 22c815f3556450b37596bad48f03aef48d397f45 (patch) | |
tree | 80681040b3d13f6ffa8fbd47d726843a4644bcd9 | |
parent | e723a6fa96bc50effbd046a2c2419cc51b3cc8c1 (diff) | |
download | vte-22c815f3556450b37596bad48f03aef48d397f45.tar.gz |
spawn: Fix build without CLOSE_RANGE_CLOEXEC
Only call close_range() when CLOSE_RANGE_CLOEXEC is defined.
Fixes the build on non-linux.
Fixes: https://gitlab.gnome.org/GNOME/vte/-/issues/2544
(cherry picked from commit 5770e39b5a908952237bc8288e5342eb08c1d5bb)
-rw-r--r-- | src/spawn.cc | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/spawn.cc b/src/spawn.cc index fd0ec654..e231105c 100644 --- a/src/spawn.cc +++ b/src/spawn.cc @@ -68,6 +68,7 @@ set_cloexec_cb(void* data, static int cloexec_from(int fd) { +#ifdef CLOSE_RANGE_CLOEXEC /* First, try close_range(CLOEXEC) which is faster than the methods * below, and works even if /proc is not available. */ @@ -78,6 +79,7 @@ cloexec_from(int fd) errno != ENOSYS /* old kernel, or not supported on this platform */ && errno != EINVAL /* flags not supported */) return res; +#endif /* CLOSE_RANGE_CLOEXEC */ /* Fall back to fdwalk */ return fdwalk(set_cloexec_cb, &fd); |