https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=221700

Conrad Meyer <c...@freebsd.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |c...@freebsd.org

--- Comment #3 from Conrad Meyer <c...@freebsd.org> ---
You might also consider closefrom() in posix_closerange() of
Modules/posixmodule.c:

--- ./Modules/posixmodule.c     2015-05-23 09:09:20.000000000 -0700
+++ ./Modules/posixmodule.c     2015-07-17 15:00:38.784909475 -0700
@@ -6668,9 +6668,12 @@
     if (!PyArg_ParseTuple(args, "ii:closerange", &fd_from, &fd_to))
         return NULL;
     Py_BEGIN_ALLOW_THREADS
-    for (i = fd_from; i < fd_to; i++)
-        if (_PyVerify_fd(i))
-            close(i);
+    if (fd_to >= sysconf(_SC_OPEN_MAX)) {
+        closefrom(fd_from);
+    } else
+        for (i = fd_from; i < fd_to; i++)
+            if (_PyVerify_fd(i))
+                close(i);
     Py_END_ALLOW_THREADS
     Py_RETURN_NONE;
 }

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
freebsd-python@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-python
To unsubscribe, send any mail to "freebsd-python-unsubscr...@freebsd.org"

Reply via email to