]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-127614: Correctly check for ttyname_r() in configure (#128503)
authorErlend E. Aasland <erlend@python.org>
Tue, 7 Jan 2025 21:42:36 +0000 (22:42 +0100)
committerGitHub <noreply@github.com>
Tue, 7 Jan 2025 21:42:36 +0000 (22:42 +0100)
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 554299b8598299c347b39a057610dec49d6fd83b..4e6c5b068c42b72b56b686ee45551864ea2367c7 100644 (file)
@@ -309,7 +309,7 @@ exit:
     return return_value;
 }
 
-#if defined(HAVE_TTYNAME)
+#if defined(HAVE_TTYNAME_R)
 
 PyDoc_STRVAR(os_ttyname__doc__,
 "ttyname($module, fd, /)\n"
@@ -342,7 +342,7 @@ exit:
     return return_value;
 }
 
-#endif /* defined(HAVE_TTYNAME) */
+#endif /* defined(HAVE_TTYNAME_R) */
 
 #if defined(HAVE_CTERMID)
 
@@ -13140,4 +13140,4 @@ os__emscripten_debugger(PyObject *module, PyObject *Py_UNUSED(ignored))
 #ifndef OS__EMSCRIPTEN_DEBUGGER_METHODDEF
     #define OS__EMSCRIPTEN_DEBUGGER_METHODDEF
 #endif /* !defined(OS__EMSCRIPTEN_DEBUGGER_METHODDEF) */
-/*[clinic end generated code: output=9c2ca1dbf986c62c input=a9049054013a1b77]*/
+/*[clinic end generated code: output=39b69b279fd637f7 input=a9049054013a1b77]*/
index 151d469983fafb9fc3930a579e5d54a106ce33c0..bb8d698bfed375face332a03ddd4fc93144ee47b 100644 (file)
@@ -3347,7 +3347,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 08c10ff52ce8d544b4c6ae294235a3e8991d9cc0..6e1b393a3ece6805953f139191e0db476842a6ba 100755 (executable)
--- a/configure
+++ b/configure
@@ -19986,10 +19986,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 fb1dd77be167b9d493aa6cec0e8a2f0a4f60e794..6d44be8959865de45b939fcc4c5c51e779849ad3 100644 (file)
@@ -5152,7 +5152,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 d862966b7de4c89b1ef9531cf4febf452cc4b24a..874b98dc96585a170e2cac8cfff1f754ea5eb25e 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'. */