]> granicus.if.org Git - sudo/commitdiff
Add back _REENTRANT define on HP-UX to expose strtok_r on some versions.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 19 Jun 2015 18:35:51 +0000 (12:35 -0600)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 19 Jun 2015 18:35:51 +0000 (12:35 -0600)
We may need to define it on other systems too.

config.h.in
configure
configure.ac

index 4fde90561cb62415d6029de0eb2f43867a178328..a4088d1099cfac8338bd81f4891a927f51aed403 100644 (file)
 # undef _XOPEN_SOURCE_EXTENDED
 #endif
 
+/* Enable reentrant versions of the standard C API (obsolete).  */
+#ifndef _REENTRANT
+# undef _REENTRANT
+#endif
+
 /* Enable "safer" versions of the standard C API (ISO C11).  */
 #ifndef __STDC_WANT_LIB_EXT1__
 # undef __STDC_WANT_LIB_EXT1__
index d69eb2f12cfecb059bcb922a8778186febb28089..469cb5a22035eac2f3246f3a71f6a5d5790b72aa 100755 (executable)
--- a/configure
+++ b/configure
@@ -14966,18 +14966,7 @@ $as_echo "$sudo_cv_var_daportable" >&6; }
                                # order of libs in 9.X is important. -lc_r must be last
                                SUDOERS_LIBS="${SUDOERS_LIBS} -ldce -lM -lc_r"
                                LIBS="${LIBS} -ldce -lM -lc_r"
-
-    case "${CPPFLAGS}" in
-       *"-D_REENTRANT"|*"-D_REENTRANT ")
-           ;;
-       *)
-           if test X"${CPPFLAGS}" = X""; then
-               CPPFLAGS="-D_REENTRANT"
-           else
-               CPPFLAGS="${CPPFLAGS} -D_REENTRANT"
-           fi
-           ;;
-    esac
+                               $as_echo "#define _REENTRANT 1" >>confdefs.h
 
 
     case "${CPPFLAGS}" in
@@ -23530,6 +23519,8 @@ if test "x$ac_cv_lib_pthread_main" = xyes; then :
   SUDO_LIBS="${SUDO_LIBS} -lpthread"
 fi
 
+       $as_echo "#define _REENTRANT 1" >>confdefs.h
+
        ;;
 esac
 
index 2d277c57e22eeb07413667c0e62a423062375973..1cf276db67b972268596630ada05684113fb1928 100644 (file)
@@ -1836,7 +1836,7 @@ case "$host" in
                                # order of libs in 9.X is important. -lc_r must be last
                                SUDOERS_LIBS="${SUDOERS_LIBS} -ldce -lM -lc_r"
                                LIBS="${LIBS} -ldce -lM -lc_r"
-                               SUDO_APPEND_CPPFLAGS(-D_REENTRANT)
+                               AC_DEFINE(_REENTRANT)
                                SUDO_APPEND_CPPFLAGS(-I/usr/include/reentrant)
                            fi
                        ;;
@@ -3814,6 +3814,7 @@ fi
 case "$host_os" in
     hpux*)
        AC_CHECK_LIB(pthread, main, [SUDO_LIBS="${SUDO_LIBS} -lpthread"])
+       AC_DEFINE(_REENTRANT)
        ;;
 esac
 
@@ -4373,6 +4374,11 @@ AH_BOTTOM([/* BSD compatibility on some SVR4 systems. */
 # undef _XOPEN_SOURCE_EXTENDED
 #endif
 
+/* Enable reentrant versions of the standard C API (obsolete).  */
+#ifndef _REENTRANT
+# undef _REENTRANT
+#endif
+
 /* Enable "safer" versions of the standard C API (ISO C11).  */
 #ifndef __STDC_WANT_LIB_EXT1__
 # undef __STDC_WANT_LIB_EXT1__