From a9886924341446064fdfc68ed4a2c1b3921c007c Mon Sep 17 00:00:00 2001 From: Nicolas Williams Date: Thu, 12 Oct 2017 23:39:59 -0500 Subject: [PATCH] Add check for getlogin_r() --- cf/krb-func-getlogin.m4 | 12 +++++++++++- include/config.h.w32 | 6 ++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/cf/krb-func-getlogin.m4 b/cf/krb-func-getlogin.m4 index 6218e6b1f..8adfddb4a 100644 --- a/cf/krb-func-getlogin.m4 +++ b/cf/krb-func-getlogin.m4 @@ -6,7 +6,7 @@ dnl AC_DEFUN([AC_FUNC_GETLOGIN], [ -AC_CHECK_FUNCS(getlogin setlogin) +AC_CHECK_FUNCS(getlogin getlogin_r setlogin) if test "$ac_cv_func_getlogin" = yes; then AC_CACHE_CHECK(if getlogin is posix, ac_cv_func_getlogin_posix, [ if test "$ac_cv_func_getlogin" = yes -a "$ac_cv_func_setlogin" = yes; then @@ -15,8 +15,18 @@ else ac_cv_func_getlogin_posix=yes fi ]) +AC_CACHE_CHECK(if getlogin_r is posix, ac_cv_func_getlogin_r_posix, [ +if test "$ac_cv_func_getlogin_r" = yes -a "$ac_cv_func_setlogin" = yes; then + ac_cv_func_getlogin_r_posix=no +else + ac_cv_func_getlogin_r_posix=yes +fi +]) if test "$ac_cv_func_getlogin_posix" = yes; then AC_DEFINE(POSIX_GETLOGIN, 1, [Define if getlogin has POSIX flavour (and not BSD).]) fi +if test "$ac_cv_func_getlogin_r_posix" = yes; then + AC_DEFINE(POSIX_GETLOGIN_R, 1, [Define if getlogin_r has POSIX flavour (and not BSD).]) +fi fi ]) diff --git a/include/config.h.w32 b/include/config.h.w32 index f00a07f03..103c41f7b 100644 --- a/include/config.h.w32 +++ b/include/config.h.w32 @@ -427,6 +427,9 @@ static const char *const rcsid[] = { (const char *)rcsid, "@(#)" msg } /* Define to 1 if you have the `getlogin' function. */ /* #define HAVE_GETLOGIN 1 */ +/* Define to 1 if you have the `getlogin_r' function. */ +/* #define HAVE_GETLOGIN_R 1 */ + /* Define if you have a working getmsg. */ /* #undef HAVE_GETMSG */ @@ -1357,6 +1360,9 @@ static const char *const rcsid[] = { (const char *)rcsid, "@(#)" msg } /* Define if getlogin has POSIX flavour (and not BSD). */ /* #define POSIX_GETLOGIN 1 */ +/* Define if getlogin_r has POSIX flavour (and not BSD). */ +/* #define POSIX_GETLOGIN_R 1 */ + /* Define if getpwnam_r has POSIX flavour. */ /* #define POSIX_GETPWNAM_R 1 */