8000 bpo-42375: subprocess DragonFlyBSD build update. (GH-23320) (GH-23389) · python/cpython@4f65907 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4f65907

Browse files
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 13b865f) Co-authored-by: David CARLIER <devnexen@gmail.com> Co-authored-by: David CARLIER <devnexen@gmail.com>
1 parent 718bf1a commit 4f65907

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
subprocess module update for DragonFlyBSD support.

Modules/_posixsubprocess.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
# endif
4242
#endif
4343

44-
#if defined(__FreeBSD__) || (defined(__APPLE__) && defined(__MACH__))
44+
#if defined(__FreeBSD__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__DragonFly__)
4545
# define FD_DIR "/dev/fd"
4646
#else
4747
# define FD_DIR "/proc/self/fd"
@@ -88,9 +88,9 @@ _pos_int_from_ascii(const char *name)
8888
}
8989

9090

91-
#if defined(__FreeBSD__)
91+
#if defined(__FreeBSD__) || defined(__DragonFly__)
9292
/* When /dev/fd isn't mounted it is often a static directory populated
93-
* with 0 1 2 or entries for 0 .. 63 on FreeBSD, NetBSD and OpenBSD.
93+
* with 0 1 2 or entries for 0 .. 63 on FreeBSD, NetBSD, OpenBSD and DragonFlyBSD.
9494
* NetBSD and OpenBSD have a /proc fs available (though not necessarily
9595
* mounted) and do not have fdescfs for /dev/fd. MacOS X has a devfs
9696
* that properly supports /dev/fd.
@@ -343,7 +343,7 @@ _close_open_fds_maybe_unsafe(long start_fd, PyObject* py_fds_to_keep)
343343
++start_fd;
344344
#endif
345345

346-
#if defined(__FreeBSD__)
346+
#if defined(__FreeBSD__) || defined(__DragonFly__)
347347
if (!_is_fdescfs_mounted_on_dev_fd())
348348
proc_fd_dir = NULL;
349349
else

0 commit comments

Comments
 (0)
0