]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-127614: Correctly check for ttyname_r() in configure (#128503) (#128599)
authorErlend E. Aasland <erlend@python.org>
Tue, 7 Jan 2025 22:05:42 +0000 (23:05 +0100)
committerGitHub <noreply@github.com>
Tue, 7 Jan 2025 22:05:42 +0000 (22:05 +0000)
(cherry picked from commit e08b28235a863323ca3a7e444776bb7803e77caf)

PR #14868 replaced the ttyname() call with ttyname_r(), but the old
check remained.

Modules/clinic/posixmodule.c.h
Modules/posixmodule.c
configure
configure.ac
pyconfig.h.in

index a33461dc5600dd0bf243edf4a1da2f999488daed..57121e1e8903a51aceae973148632c54862910b5 100644 (file)
@@ -304,7 +304,7 @@ exit:
     return return_value;
 }
 
-#if defined(HAVE_TTYNAME)
+#if defined(HAVE_TTYNAME_R)
 
 PyDoc_STRVAR(os_ttyname__doc__,
 "ttyname($module, fd, /)\n"
@@ -337,7 +337,7 @@ exit:
     return return_value;
 }
 
-#endif /* defined(HAVE_TTYNAME) */
+#endif /* defined(HAVE_TTYNAME_R) */
 
 #if defined(HAVE_CTERMID)
 
@@ -12032,4 +12032,4 @@ exit:
 #ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF
     #define OS_WAITSTATUS_TO_EXITCODE_METHODDEF
 #endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */
-/*[clinic end generated code: output=6d34c4564aca7725 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=efe45f93561db8d3 input=a9049054013a1b77]*/
index 82078a569881a057e7fc9d29a366c52d8d8ddd7d..deabc103056642a41dec7bd3ec7d57e47ecc05e9 100644 (file)
@@ -3237,7 +3237,7 @@ os_access_impl(PyObject *module, path_t *path, int mode, int dir_fd,
 #endif
 
 
-#ifdef HAVE_TTYNAME
+#ifdef HAVE_TTYNAME_R
 /*[clinic input]
 os.ttyname
 
index 32c9600b2e8cac0cd2f3aac6c1c2e917aaba4767..89edc42f45c361c8d5c0321869169159575adb37 100755 (executable)
--- a/configure
+++ b/configure
@@ -18553,10 +18553,10 @@ then :
   printf "%s\n" "#define HAVE_TRUNCATE 1" >>confdefs.h
 
 fi
-ac_fn_c_check_func "$LINENO" "ttyname" "ac_cv_func_ttyname"
-if test "x$ac_cv_func_ttyname" = xyes
+ac_fn_c_check_func "$LINENO" "ttyname_r" "ac_cv_func_ttyname_r"
+if test "x$ac_cv_func_ttyname_r" = xyes
 then :
-  printf "%s\n" "#define HAVE_TTYNAME 1" >>confdefs.h
+  printf "%s\n" "#define HAVE_TTYNAME_R 1" >>confdefs.h
 
 fi
 ac_fn_c_check_func "$LINENO" "umask" "ac_cv_func_umask"
index 0f60c849965719d00f8f7036f38c664d5a4c25ad..1a02d19f1b2a3fadb775091e9f721f1d8771b7fc 100644 (file)
@@ -4941,7 +4941,7 @@ AC_CHECK_FUNCS([ \
   sigfillset siginterrupt sigpending sigrelse sigtimedwait sigwait \
   sigwaitinfo snprintf splice strftime strlcpy strsignal symlinkat sync \
   sysconf system tcgetpgrp tcsetpgrp tempnam timegm times tmpfile \
-  tmpnam tmpnam_r truncate ttyname umask uname unlinkat utimensat utimes vfork \
+  tmpnam tmpnam_r truncate ttyname_r umask uname unlinkat utimensat utimes vfork \
   wait wait3 wait4 waitid waitpid wcscoll wcsftime wcsxfrm wmemcmp writev \
 ])
 
index 167c6a11411aa68abb1d3a502ab178de1fc62351..df4d29fe5497a49cc1fe085284de24e2c6860075 100644 (file)
 /* Define to 1 if you have the `truncate' function. */
 #undef HAVE_TRUNCATE
 
-/* Define to 1 if you have the `ttyname' function. */
-#undef HAVE_TTYNAME
+/* Define to 1 if you have the `ttyname_r' function. */
+#undef HAVE_TTYNAME_R
 
 /* Define to 1 if you don't have `tm_zone' but do have the external array
    `tzname'. */