From 264d7afe5508780adeea6a16f49c2ae98ad709d2 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Wed, 12 Sep 2018 16:35:49 -0700 Subject: [PATCH 1/2] bpo-34652: Remove lchmod from the big func checking block. A fix for 883702ebb8bbfa749ef0040d1b58d6222bf589ee. --- configure | 2 +- configure.ac | 2 +- pyconfig.h.in | 3 --- 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/configure b/configure index d341453443fc4cc..535182080e759b2 100755 --- a/configure +++ b/configure @@ -11258,7 +11258,7 @@ for ac_func in alarm accept4 setitimer getitimer bind_textdomain_codeset chown \ getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \ getpriority getresuid getresgid getpwent getpwnam_r getpwuid_r getspnam getspent getsid getwd \ if_nameindex \ - initgroups kill killpg lchmod lchown lockf linkat lstat lutimes mmap \ + initgroups kill killpg 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 posix_spawn pread preadv preadv2 \ diff --git a/configure.ac b/configure.ac index cf7328c4032a95f..7f3e55b66bcc8e5 100644 --- a/configure.ac +++ b/configure.ac @@ -3438,7 +3438,7 @@ AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \ getgrouplist getgroups getlogin getloadavg getpeername getpgid getpid \ getpriority getresuid getresgid getpwent getpwnam_r getpwuid_r getspnam getspent getsid getwd \ if_nameindex \ - initgroups kill killpg lchmod lchown lockf linkat lstat lutimes mmap \ + initgroups kill killpg 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 posix_spawn pread preadv preadv2 \ diff --git a/pyconfig.h.in b/pyconfig.h.in index 360f79994fafe1a..5463d8ff379d13c 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -557,9 +557,6 @@ /* Define to 1 if you have the 'lchflags' function. */ #undef HAVE_LCHFLAGS -/* Define to 1 if you have the `lchmod' function. */ -#undef HAVE_LCHMOD - /* Define to 1 if you have the `lchown' function. */ #undef HAVE_LCHOWN From 4b428b54824c8574168e1e332aa0f4632963fee8 Mon Sep 17 00:00:00 2001 From: Benjamin Peterson Date: Wed, 12 Sep 2018 16:47:58 -0700 Subject: [PATCH 2/2] use AC_CHECK_FUNCS --- configure | 6 ++++++ configure.ac | 2 +- pyconfig.h.in | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 535182080e759b2..ddfd1c4434c26dc 100755 --- a/configure +++ b/configure @@ -11289,10 +11289,16 @@ done # links. Some libc implementations have a stub lchmod implementation that always # returns an error. if test "$MACHDEP" != linux; then + for ac_func in lchmod +do : ac_fn_c_check_func "$LINENO" "lchmod" "ac_cv_func_lchmod" if test "x$ac_cv_func_lchmod" = xyes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LCHMOD 1 +_ACEOF fi +done fi diff --git a/configure.ac b/configure.ac index 7f3e55b66bcc8e5..cc1bba4b384d946 100644 --- a/configure.ac +++ b/configure.ac @@ -3458,7 +3458,7 @@ AC_CHECK_FUNCS(alarm accept4 setitimer getitimer bind_textdomain_codeset chown \ # links. Some libc implementations have a stub lchmod implementation that always # returns an error. if test "$MACHDEP" != linux; then - AC_CHECK_FUNC(lchmod) + AC_CHECK_FUNCS(lchmod) fi AC_CHECK_DECL(dirfd, diff --git a/pyconfig.h.in b/pyconfig.h.in index 5463d8ff379d13c..360f79994fafe1a 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -557,6 +557,9 @@ /* Define to 1 if you have the 'lchflags' function. */ #undef HAVE_LCHFLAGS +/* Define to 1 if you have the `lchmod' function. */ +#undef HAVE_LCHMOD + /* Define to 1 if you have the `lchown' function. */ #undef HAVE_LCHOWN