mirror of
https://github.com/python/cpython.git
synced 2026-05-06 12:49:07 -04:00
[3.13] gh-141659: Fix bad file descriptor error in subprocess on AIX (GH-141660) (#141828)
Co-authored-by: Ayappan Perumal <ayappap2@in.ibm.com>
This commit is contained in:
committed by
GitHub
parent
5285ccc19e
commit
af94f62bf6
@@ -0,0 +1 @@
|
||||
Fix bad file descriptor errors from ``_posixsubprocess`` on AIX.
|
||||
@@ -512,7 +512,13 @@ _close_open_fds_maybe_unsafe(int start_fd, int *fds_to_keep,
|
||||
proc_fd_dir = NULL;
|
||||
else
|
||||
#endif
|
||||
#if defined(_AIX)
|
||||
char fd_path[PATH_MAX];
|
||||
snprintf(fd_path, sizeof(fd_path), "/proc/%ld/fd", (long)getpid());
|
||||
proc_fd_dir = opendir(fd_path);
|
||||
#else
|
||||
proc_fd_dir = opendir(FD_DIR);
|
||||
#endif
|
||||
if (!proc_fd_dir) {
|
||||
/* No way to get a list of open fds. */
|
||||
_close_range_except(start_fd, -1, fds_to_keep, fds_to_keep_len,
|
||||
|
||||
Reference in New Issue
Block a user