Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Modules/_posixsubprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,11 @@ _close_open_fds_safe(int start_fd, int *fds_to_keep, Py_ssize_t fds_to_keep_len)
Py_ssize_t bytes;
while (1) {
#ifdef HAVE_GETDENTS64
bytes = getdents64(fd_dir_fd, buffer, sizeof(buffer));
/* musl <1.2.4 headers expose `getdents64` as an alias for `getdents`, whose buffer parameter
* is `struct dirent *`. We use `void *` to support both that interface and the glibc declaration
* without an incompatible-pointer diagnostic.
*/
bytes = getdents64(fd_dir_fd, (void *)buffer, sizeof(buffer));
Comment thread
zanieb marked this conversation as resolved.
#else
bytes = syscall(SYS_getdents64, fd_dir_fd,
(struct py_dirent64 *)buffer, sizeof(buffer));
Expand Down
Loading