]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.13] gh-127614: Correctly check for ttyname_r() in configure (#128503) (#128598)
authorErlend E. Aasland <erlend@python.org>
Sat, 11 Jan 2025 11:47:49 +0000 (12:47 +0100)
committerGitHub <noreply@github.com>
Sat, 11 Jan 2025 11:47:49 +0000 (11:47 +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 6a3aacf13e74ad891e92a3ecf44ce0c7b65dc7a1..b69817ae9bb4828d6eaba3a984dcb88416266310 100644 (file)
@@ -306,7 +306,7 @@ exit:
     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 @@ exit:
     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]*/
index 401160640df440c2b3ac84343f1c21e4af37e994..d1d6b247d1ed58a146bcbf25c84429bb1aaa4f7f 100644 (file)
@@ -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
 
index ff8e29de1439ec5432c70cdc8096f7b44c1b2d0d..1cd1f690f7b9c11c51cf4f84e64af82638e6b6a6 100755 (executable)
--- 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"
index dd4e0b4723c1d3b013ad755b07f2368c97fcb445..3fcb18922c53307a034e70b8f99fb738c86b6491 100644 (file)
@@ -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 \
 ])
 
index 59bbdc1c162610fd3ecda4cc981eb622341e0162..3c16c694c84599a1892b3147fc8761d8f4a8b2db 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'. */