mirror of
https://github.com/beard7n/bsdports.git
synced 2026-04-11 11:01:18 +02:00
create bsd12 branch
This commit is contained in:
25
lang/python36/files/patch-Modules___posixsubprocess.c
Normal file
25
lang/python36/files/patch-Modules___posixsubprocess.c
Normal file
@@ -0,0 +1,25 @@
|
||||
# Add closefrom(2) support
|
||||
# https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=242274
|
||||
# https://bugs.python.org/issue38061
|
||||
# TODO: Upstream
|
||||
|
||||
--- Modules/_posixsubprocess.c.orig 2019-07-02 20:25:39 UTC
|
||||
+++ Modules/_posixsubprocess.c
|
||||
@@ -236,8 +236,15 @@ _close_fds_by_brute_force(long start_fd, PyObject *py_
|
||||
start_fd = keep_fd + 1;
|
||||
}
|
||||
if (start_fd <= end_fd) {
|
||||
- for (fd_num = start_fd; fd_num < end_fd; ++fd_num) {
|
||||
- close(fd_num);
|
||||
+#ifdef __FreeBSD__
|
||||
+ if (end_fd >= sysconf(_SC_OPEN_MAX)) {
|
||||
+ closefrom(start_fd);
|
||||
+ } else
|
||||
+#endif
|
||||
+ {
|
||||
+ for (fd_num = start_fd; fd_num < end_fd; ++fd_num) {
|
||||
+ close(fd_num);
|
||||
+ }
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user