Skip to content

Commit

Permalink
Disabled close range for Android kernel
Browse files Browse the repository at this point in the history
Without this patch in Android proot environment linux desktop GUI unable to run.. always reporting error like `Unable to launch desktop environment with proot (Failed to close file descriptor for child process (Invalid argument))`

proot-me/proot#357
  • Loading branch information
Saikatsaha1996 committed Apr 28, 2024
1 parent 5488829 commit c6f1cf9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions glib/glib-unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,8 @@ g_fdwalk_set_cloexec (int lowfd)

g_return_val_if_fail (lowfd >= 0, (errno = EINVAL, -1));

#if defined(HAVE_CLOSE_RANGE) && defined(CLOSE_RANGE_CLOEXEC)
//#if defined(HAVE_CLOSE_RANGE) && defined(CLOSE_RANGE_CLOEXEC)
#if defined(_NOPE___DISABLE_THIS__HAVE_CLOSE_RANGE) && defined(CLOSE_RANGE_CLOEXEC)
/* 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
Expand Down Expand Up @@ -876,7 +877,8 @@ g_closefrom (int lowfd)

g_return_val_if_fail (lowfd >= 0, (errno = EINVAL, -1));

#if defined(HAVE_CLOSE_RANGE)
//#if defined(HAVE_CLOSE_RANGE)
#if defined(_NOPE___DISABLE_THIS__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
Expand Down

0 comments on commit c6f1cf9

Please sign in to comment.