Skip to content

Commit 13b865f

Browse files
authored
bpo-42375: subprocess DragonFlyBSD build update. (GH-23320)
Same as FreeBSD, file descriptors in /dev/fd id from 0 to 63.
1 parent 4687338 commit 13b865f

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
@@ -55,7 +55,7 @@
5555
# endif
5656
#endif
5757

58-
#if defined(__FreeBSD__) || (defined(__APPLE__) && defined(__MACH__))
58+
#if defined(__FreeBSD__) || (defined(__APPLE__) && defined(__MACH__)) || defined(__DragonFly__)
5959
# define FD_DIR "/dev/fd"
6060
#else
6161
# define FD_DIR "/proc/self/fd"
@@ -127,9 +127,9 @@ _pos_int_from_ascii(const char *name)
127127
}
128128

129129

130-
#if defined(__FreeBSD__)
130+
#if defined(__FreeBSD__) || defined(__DragonFly__)
131131
/* When /dev/fd isn't mounted it is often a static directory populated
132-
* with 0 1 2 or entries for 0 .. 63 on FreeBSD, NetBSD and OpenBSD.
132+
* with 0 1 2 or entries for 0 .. 63 on FreeBSD, NetBSD, OpenBSD and DragonFlyBSD.
133133
* NetBSD and OpenBSD have a /proc fs available (though not necessarily
134134
* mounted) and do not have fdescfs for /dev/fd. MacOS X has a devfs
135135
* that properly supports /dev/fd.
@@ -377,7 +377,7 @@ _close_open_fds_maybe_unsafe(long start_fd, PyObject* py_fds_to_keep)
377377
++start_fd;
378378
#endif
379379

380-
#if defined(__FreeBSD__)
380+
#if defined(__FreeBSD__) || defined(__DragonFly__)
381381
if (!_is_fdescfs_mounted_on_dev_fd())
382382
proc_fd_dir = NULL;
383383
else

0 commit comments

Comments
 (0)