[openssh-commits] [openssh] 01/03: Check if -D_REENTRANT is needed for localtime_r.

git+noreply at mindrot.org git+noreply at mindrot.org
Thu May 7 15:39:42 AEST 2020


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch master
in repository openssh.

commit 59d531553fd90196946743da391f3a27cf472f4e
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Thu May 7 15:34:12 2020 +1000

    Check if -D_REENTRANT is needed for localtime_r.
    
    On at least HP-UX 11.11, the localtime_r declararation is behind
    ifdef _REENTRANT.  Check for and add if needed.
---
 configure.ac | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/configure.ac b/configure.ac
index e89d4f17..3712d55d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1969,6 +1969,19 @@ AC_SEARCH_LIBS([nanosleep], [rt posix4], [AC_DEFINE([HAVE_NANOSLEEP], [1],
 AC_SEARCH_LIBS([clock_gettime], [rt],
 	[AC_DEFINE([HAVE_CLOCK_GETTIME], [1], [Have clock_gettime])])
 
+dnl check if we need -D_REENTRANT for localtime_r declaration.
+AC_CHECK_DECL([localtime_r], [],
+	[ saved_CPPFLAGS="$CFLAGS"
+	  CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+	  unset ac_cv_have_decl_localtime_r
+	  AC_CHECK_DECL([localtime_r], [],
+		[ CPPFLAGS="$saved_CPPFLAGS" ],
+		[ #include <time.h> ]
+	  )
+	],
+	[ #include <time.h> ]
+)
+
 dnl Make sure prototypes are defined for these before using them.
 AC_CHECK_DECL([strsep],
 	[AC_CHECK_FUNCS([strsep])],

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list