https://github.com/python/cpython/commit/436064afd88bf19b6d6885485cee39a331e406c5
commit: 436064afd88bf19b6d6885485cee39a331e406c5
branch: 3.13
author: Erlend E. Aasland <[email protected]>
committer: erlend-aasland <[email protected]>
date: 2025-01-11T11:47:49Z
summary:

[3.13] gh-127614: Correctly check for ttyname_r() in configure (#128503) 
(#128598)

(cherry picked from commit e08b28235a863323ca3a7e444776bb7803e77caf)

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

files:
M Modules/clinic/posixmodule.c.h
M Modules/posixmodule.c
M configure
M configure.ac
M pyconfig.h.in

diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h
index 6a3aacf13e74ad..b69817ae9bb482 100644
--- a/Modules/clinic/posixmodule.c.h
+++ b/Modules/clinic/posixmodule.c.h
@@ -306,7 +306,7 @@ os_access(PyObject *module, PyObject *const *args, 
Py_ssize_t nargs, PyObject *k
     return return_value;
 }
 
-#if defined(HAVE_TTYNAME)
+#if defined(HAVE_TTYNAME_R)
 
 PyDoc_STRVAR(os_ttyname__doc__,
 "ttyname($module, fd, /)\n"
@@ -339,7 +339,7 @@ os_ttyname(PyObject *module, PyObject *arg)
     return return_value;
 }
 
-#endif /* defined(HAVE_TTYNAME) */
+#endif /* defined(HAVE_TTYNAME_R) */
 
 #if defined(HAVE_CTERMID)
 
@@ -12879,4 +12879,4 @@ os__is_inputhook_installed(PyObject *module, PyObject 
*Py_UNUSED(ignored))
 #ifndef OS__SUPPORTS_VIRTUAL_TERMINAL_METHODDEF
     #define OS__SUPPORTS_VIRTUAL_TERMINAL_METHODDEF
 #endif /* !defined(OS__SUPPORTS_VIRTUAL_TERMINAL_METHODDEF) */
-/*[clinic end generated code: output=a4410a686958d8e6 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=a75be356cd4abca5 input=a9049054013a1b77]*/
diff --git a/Modules/posixmodule.c b/Modules/posixmodule.c
index 401160640df440..d1d6b247d1ed58 100644
--- a/Modules/posixmodule.c
+++ b/Modules/posixmodule.c
@@ -3298,7 +3298,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
 
diff --git a/configure b/configure
index ff8e29de1439ec..1cd1f690f7b9c1 100755
--- a/configure
+++ b/configure
@@ -18943,10 +18943,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"
diff --git a/configure.ac b/configure.ac
index dd4e0b4723c1d3..3fcb18922c5330 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5134,7 +5134,7 @@ AC_CHECK_FUNCS([ \
   sigfillset siginterrupt sigpending sigrelse sigtimedwait sigwait \
   sigwaitinfo snprintf splice strftime strlcpy strsignal symlinkat sync \
   sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile \
-  tmpnam tmpnam_r truncate ttyname umask uname unlinkat unlockpt utimensat 
utimes vfork \
+  tmpnam tmpnam_r truncate ttyname_r umask uname unlinkat unlockpt utimensat 
utimes vfork \
   wait wait3 wait4 waitid waitpid wcscoll wcsftime wcsxfrm wmemcmp writev \
 ])
 
diff --git a/pyconfig.h.in b/pyconfig.h.in
index 59bbdc1c162610..3c16c694c84599 100644
--- a/pyconfig.h.in
+++ b/pyconfig.h.in
@@ -1494,8 +1494,8 @@
 /* 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'. */

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to