mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #22524: Fix os.scandir() for platforms which don't have a d_type field in
the dirent structure (ex: OpenIndiana).
This commit is contained in:
parent
6036e4431d
commit
35a97c0bed
4 changed files with 82 additions and 11 deletions
20
configure.ac
20
configure.ac
|
@ -4944,6 +4944,26 @@ AS_CASE($with_ensurepip,
|
|||
AC_MSG_RESULT($ENSUREPIP)
|
||||
AC_SUBST(ENSUREPIP)
|
||||
|
||||
# check if the dirent structure of a d_type field and DT_UNKNOWN is defined
|
||||
AC_MSG_CHECKING(if the dirent structure of a d_type field)
|
||||
AC_LINK_IFELSE(
|
||||
[
|
||||
AC_LANG_SOURCE([[
|
||||
#include <dirent.h>
|
||||
|
||||
int main() {
|
||||
struct dirent entry;
|
||||
return entry.d_type == DT_UNKNOWN;
|
||||
}
|
||||
]])
|
||||
],[have_dirent_d_type=yes],[have_dirent_d_type=no])
|
||||
AC_MSG_RESULT($have_dirent_d_type)
|
||||
|
||||
if test "$have_dirent_d_type" = yes; then
|
||||
AC_DEFINE(HAVE_DIRENT_D_TYPE, 1,
|
||||
[Define to 1 if the dirent structure has a d_type field])
|
||||
fi
|
||||
|
||||
# generate output files
|
||||
AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc Misc/python-config.sh)
|
||||
AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue