]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Improve the test for dirfd(). Some systems #define it rather than
authorGregory P. Smith <greg@krypto.org>
Sun, 22 Jan 2012 02:21:56 +0000 (18:21 -0800)
committerGregory P. Smith <greg@krypto.org>
Sun, 22 Jan 2012 02:21:56 +0000 (18:21 -0800)
have it as a library function.

1  2 
configure
configure.in
pyconfig.h.in

diff --cc configure
index 10ee46ca570b6c60f94f46b9c1d90503a5e2973c,5f00c1ecfafbee1545925aa1c72aac6febf89844..ebae8f5b5ca1be5ba65d021fe604223b2abcbd40
+++ b/configure
@@@ -9396,27 -9410,19 +9396,27 @@@ $as_echo "MACHDEP_OBJS" >&6; 
  
  # checks for library functions
  for ac_func in alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
-  clock confstr ctermid dirfd execv faccessat fchmod fchmodat fchown fchownat \
 - clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \
 - gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
++ clock confstr ctermid execv faccessat fchmod fchmodat fchown fchownat \
 + fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \
 + futimens futimes gai_strerror \
 + getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
   getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \
 - initgroups kill killpg lchmod lchown lstat mbrtowc mkfifo mknod mktime \
 - mremap nice pathconf pause plock poll pthread_init \
 - putenv readlink realpath \
 - select sem_open sem_timedwait sem_getvalue sem_unlink setegid seteuid \
 - setgid \
 - setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setuid setvbuf \
 - sigaction siginterrupt sigrelse snprintf strftime strlcpy \
 + if_nameindex \
 + initgroups kill killpg lchmod lchown lockf linkat lstat lutimes mmap \
 + memrchr mbrtowc mkdirat mkfifo \
 + mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \
 + posix_fallocate posix_fadvise pread \
 + pthread_init pthread_kill putenv pwrite readlink readlinkat readv realpath renameat \
 + select sem_open sem_timedwait sem_getvalue sem_unlink sendfile setegid seteuid \
 + setgid sethostname \
 + setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setpriority setuid setvbuf \
 + sched_get_priority_max sched_setaffinity sched_setscheduler sched_setparam \
 + sched_rr_get_interval \
 + sigaction sigaltstack siginterrupt sigpending sigrelse \
 + sigtimedwait sigwait sigwaitinfo snprintf strftime strlcpy symlinkat sync \
   sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
 - truncate uname unsetenv utimes waitpid wait3 wait4 \
 - wcscoll wcsftime wcsxfrm _getpty
 + truncate uname unlinkat unsetenv utimensat utimes waitid waitpid wait3 wait4 \
 + wcscoll wcsftime wcsxfrm writev _getpty
  do :
    as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
  ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
diff --cc configure.in
index 0aa094a80f3fc6c6e13e03bd6ce3e7ac94c6847d,138d562011a20687629ecc809d1dea7fb4d5a5e6..f0beb6bbcc5f89843188d824e149521eca54da19
@@@ -2562,28 -2587,26 +2562,34 @@@ AC_MSG_RESULT(MACHDEP_OBJS
  
  # checks for library functions
  AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \
-  clock confstr ctermid dirfd execv faccessat fchmod fchmodat fchown fchownat \
 - clock confstr ctermid execv fchmod fchown fork fpathconf ftime ftruncate \
 - gai_strerror getgroups getlogin getloadavg getpeername getpgid getpid \
++ clock confstr ctermid execv faccessat fchmod fchmodat fchown fchownat \
 + fexecve fdopendir fork fpathconf fstatat ftime ftruncate futimesat \
 + futimens futimes gai_strerror \
 + getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \
   getpriority getresuid getresgid getpwent getspnam getspent getsid getwd \
 - initgroups kill killpg lchmod lchown lstat mbrtowc mkfifo mknod mktime \
 - mremap nice pathconf pause plock poll pthread_init \
 - putenv readlink realpath \
 - select sem_open sem_timedwait sem_getvalue sem_unlink setegid seteuid \
 - setgid \
 - setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setuid setvbuf \
 - sigaction siginterrupt sigrelse snprintf strftime strlcpy \
 + if_nameindex \
 + initgroups kill killpg lchmod lchown lockf linkat lstat lutimes mmap \
 + memrchr mbrtowc mkdirat mkfifo \
 + mkfifoat mknod mknodat mktime mremap nice openat pathconf pause pipe2 plock poll \
 + posix_fallocate posix_fadvise pread \
 + pthread_init pthread_kill putenv pwrite readlink readlinkat readv realpath renameat \
 + select sem_open sem_timedwait sem_getvalue sem_unlink sendfile setegid seteuid \
 + setgid sethostname \
 + setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setpriority setuid setvbuf \
 + sched_get_priority_max sched_setaffinity sched_setscheduler sched_setparam \
 + sched_rr_get_interval \
 + sigaction sigaltstack siginterrupt sigpending sigrelse \
 + sigtimedwait sigwait sigwaitinfo snprintf strftime strlcpy symlinkat sync \
   sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \
 - truncate uname unsetenv utimes waitpid wait3 wait4 \
 - wcscoll wcsftime wcsxfrm _getpty)
 + truncate uname unlinkat unsetenv utimensat utimes waitid waitpid wait3 wait4 \
 + wcscoll wcsftime wcsxfrm writev _getpty)
  
+ AC_CHECK_DECL(dirfd,
+     AC_DEFINE(HAVE_DIRFD, 1,
+               Define if you have the 'dirfd' function or macro.), ,
+       [#include <sys/types.h>
+        #include <dirent.h>])
  # For some functions, having a definition is not sufficient, since
  # we want to take their address.
  AC_MSG_CHECKING(for chroot)
diff --cc pyconfig.h.in
Simple merge