mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-141659: Fix bad file descriptor error in subprocess on AIX (GH-141660)
/proc/self does not exist on AIX.
This commit is contained in:
parent
7b0b708675
commit
92c5de73b8
2 changed files with 7 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
Fix bad file descriptor errors from ``_posixsubprocess`` on AIX.
|
||||
|
|
@ -514,7 +514,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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue