summaryrefslogtreecommitdiffstats
path: root/Python
diff options
context:
space:
mode:
Diffstat (limited to 'Python')
-rw-r--r--Python/fileutils.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Python/fileutils.c b/Python/fileutils.c
index 111d7fa..d1d62dc 100644
--- a/Python/fileutils.c
+++ b/Python/fileutils.c
@@ -2624,10 +2624,11 @@ _Py_closerange(int first, int last)
first = Py_MAX(first, 0);
_Py_BEGIN_SUPPRESS_IPH
#ifdef HAVE_CLOSE_RANGE
- if (close_range(first, last, 0) == 0 || errno != ENOSYS) {
- /* Any errors encountered while closing file descriptors are ignored;
- * ENOSYS means no kernel support, though,
- * so we'll fallback to the other methods. */
+ if (close_range(first, last, 0) == 0) {
+ /* close_range() ignores errors when it closes file descriptors.
+ * Possible reasons of an error return are lack of kernel support
+ * or denial of the underlying syscall by a seccomp sandbox on Linux.
+ * Fallback to other methods in case of any error. */
}
else
#endif /* HAVE_CLOSE_RANGE */