diff options
author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2020-12-17 11:16:00 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-17 11:16:00 (GMT) |
commit | 4f65907f38339809532bc06ffc1382c2c09180e2 (patch) | |
tree | db768c400c5b7f70a5e788222e4949d00861b561 | |
parent | 718bf1a7a1a39ca6f2381a299d00d8318732104a (diff) | |
download | cpython-4f65907f38339809532bc06ffc1382c2c09180e2.zip cpython-4f65907f38339809532bc06ffc1382c2c09180e2.tar.gz cpython-4f65907f38339809532bc06ffc1382c2c09180e2.tar.bz2 |
bpo-42375: subprocess DragonFlyBSD build update. (GH-23320) (GH-23389)
Same as FreeBSD, file descriptors in /dev/fd id from 0 to 63.
(cherry picked from commit 13b865f0e17c88b081c23f7f05cf91166d220a50)
Co-authored-by: David CARLIER <devnexen@gmail.com>
Co-authored-by: David CARLIER <devnexen@gmail.com>
-rw-r--r-- | Misc/NEWS.d/next/Library/2020-11-19-04-13-53.bpo-42375.U8bp4s.rst | 1 | ||||
-rw-r--r-- | Modules/_posixsubprocess.c | 8 |
2 files changed, 5 insertions, 4 deletions
diff --git a/Misc/NEWS.d/next/Library/2020-11-19-04-13-53.bpo-42375.U8bp4s.rst b/Misc/NEWS.d/next/Library/2020-11-19-04-13-53.bpo-42375.U8bp4s.rst new file mode 100644 index 0000000..6d8c80c --- /dev/null +++ b/Misc/NEWS.d/next/Library/2020-11-19-04-13-53.bpo-42375.U8bp4s.rst @@ -0,0 +1 @@ +subprocess module update for DragonFlyBSD support.
\ No newline at end of file diff --git a/Modules/_posixsubprocess.c b/Modules/_posixsubprocess.c index e693e53..05c051c 100644 --- a/Modules/_posixsubprocess.c +++ b/Modules/_posixsubprocess.c @@ -41,7 +41,7 @@ # endif #endif -#if defined(__FreeBSD__) || (defined(__APPLE__) && defined(__MACH__)) +#if defined(__FreeBSD__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__DragonFly__) # define FD_DIR "/dev/fd" #else # define FD_DIR "/proc/self/fd" @@ -88,9 +88,9 @@ _pos_int_from_ascii(const char *name) } -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(__DragonFly__) /* When /dev/fd isn't mounted it is often a static directory populated - * with 0 1 2 or entries for 0 .. 63 on FreeBSD, NetBSD and OpenBSD. + * with 0 1 2 or entries for 0 .. 63 on FreeBSD, NetBSD, OpenBSD and DragonFlyBSD. * NetBSD and OpenBSD have a /proc fs available (though not necessarily * mounted) and do not have fdescfs for /dev/fd. MacOS X has a devfs * that properly supports /dev/fd. @@ -343,7 +343,7 @@ _close_open_fds_maybe_unsafe(long start_fd, PyObject* py_fds_to_keep) ++start_fd; #endif -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(__DragonFly__) if (!_is_fdescfs_mounted_on_dev_fd()) proc_fd_dir = NULL; else |