bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

getlogin_r on HP-UX 11


From: Bruno Haible
Subject: getlogin_r on HP-UX 11
Date: Mon, 20 Dec 2010 12:24:17 +0100
User-agent: KMail/1.9.9

On HP-UX 11.11, I'm seeing this error:

cc -Ae -O -DHAVE_CONFIG_H -I.  -DGNULIB_STRICT_CHECKING=1  -I. -I.  -I.. -I./.. 
 -I../gllib -I./../gllib    -g -c -o test-getlogin_r.o test-getlogin_r.c
cc: "test-getlogin_r.c", line 24: error 1588: "getlogin_r" undefined.
cc: "test-getlogin_r.c", line 24: error 1521: Incorrect initialization.
*** Error exit code 1

It's because <unistd.h> declares getlogin_r only if _REENTRANT is defined.

This fixes it:


2010-12-20  Bruno Haible  <address@hidden>

        getlogin_r: Add missing declaration on HP-UX 11.
        * m4/getlogin_r.m4 (gl_FUNC_GETLOGIN_R): Test whether getlogin_r is
        declared also when it exists as a function.

--- m4/getlogin_r.m4.orig       Mon Dec 20 12:20:03 2010
+++ m4/getlogin_r.m4    Mon Dec 20 11:58:14 2010
@@ -1,4 +1,4 @@
-#serial 7
+#serial 8
 
 # Copyright (C) 2005-2007, 2009-2010 Free Software Foundation, Inc.
 #
@@ -20,14 +20,15 @@
   dnl getlogin_r().
   AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
 
+  AC_CHECK_DECLS_ONCE([getlogin_r])
+  if test $ac_cv_have_decl_getlogin_r = no; then
+    HAVE_DECL_GETLOGIN_R=0
+  fi
+
   AC_CHECK_FUNCS_ONCE([getlogin_r])
   if test $ac_cv_func_getlogin_r = no; then
     AC_LIBOBJ([getlogin_r])
     gl_PREREQ_GETLOGIN_R
-    AC_CHECK_DECLS_ONCE([getlogin_r])
-    if test $ac_cv_have_decl_getlogin_r = no; then
-      HAVE_DECL_GETLOGIN_R=0
-    fi
   fi
 ])
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]