Skip to content

Commit dfbc0e9

Browse files
authored
Apply suggestion from @zanieb
1 parent 6b4ceca commit dfbc0e9

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

‎Modules/_posixsubprocess.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,9 @@ _close_open_fds_safe(int start_fd, int *fds_to_keep, Py_ssize_t fds_to_keep_len)
436436
Py_ssize_t bytes;
437437
while (1) {
438438
#ifdef HAVE_GETDENTS64
439+
# musl <1.2.4 headers expose `getdents64` as an alias for `getdents`, whose buffer parameter
440+
# is `struct dirent *`. We use `void *` to support both that interface and the glibc declaration
441+
# without an incompatible-pointer diagnostic.
439442
bytes = getdents64(fd_dir_fd, (void *)buffer, sizeof(buffer));
440443
#else
441444
bytes = syscall(SYS_getdents64, fd_dir_fd,

0 commit comments

Comments
 (0)