Skip to content

Commit

Permalink
bpo-42375: subprocess DragonFlyBSD build update. (pythonGH-23320)
Browse files Browse the repository at this point in the history
Same as FreeBSD, file descriptors in /dev/fd id from 0 to 63.
  • Loading branch information
devnexen authored Nov 19, 2020
1 parent 4687338 commit 13b865f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
subprocess module update for DragonFlyBSD support.
8 changes: 4 additions & 4 deletions Modules/_posixsubprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,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"
Expand Down Expand Up @@ -127,9 +127,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.
Expand Down Expand Up @@ -377,7 +377,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
Expand Down

0 comments on commit 13b865f

Please sign in to comment.