configure: check whether fgetpwent_r is available before marking xprefix_getpwnam_r as reentrant
This commit is contained in:
committed by
Iker Pedrosa
parent
68bf73f319
commit
cc0aaaa18f
@@ -678,6 +678,8 @@ if test "$with_skey" = "yes"; then
|
||||
]])],[AC_DEFINE(SKEY_BSD_STYLE, 1, [Define to support newer BSD S/Key API])],[])
|
||||
fi
|
||||
|
||||
AC_CHECK_FUNC(fgetpwent_r, [AC_DEFINE(HAVE_FGETPWENT_R, 1, [Defined to 1 if you have the declaration of 'fgetpwent_r'])])
|
||||
|
||||
AC_DEFINE_UNQUOTED(SHELL, ["$SHELL"], [The default shell.])
|
||||
|
||||
AM_GNU_GETTEXT_VERSION([0.19])
|
||||
|
||||
@@ -324,8 +324,10 @@ extern struct group *prefix_getgrnam(const char *name);
|
||||
extern struct group *prefix_getgrgid(gid_t gid);
|
||||
extern struct passwd *prefix_getpwuid(uid_t uid);
|
||||
extern struct passwd *prefix_getpwnam(const char* name);
|
||||
#if HAVE_FGETPWENT_R
|
||||
extern int prefix_getpwnam_r(const char* name, struct passwd* pwd,
|
||||
char* buf, size_t buflen, struct passwd** result);
|
||||
#endif
|
||||
extern struct spwd *prefix_getspnam(const char* name);
|
||||
extern struct group *prefix_getgr_nam_gid(const char *grname);
|
||||
extern void prefix_setpwent(void);
|
||||
|
||||
@@ -238,6 +238,7 @@ extern struct passwd *prefix_getpwnam(const char* name)
|
||||
return getpwnam(name);
|
||||
}
|
||||
}
|
||||
#if HAVE_FGETPWENT_R
|
||||
extern int prefix_getpwnam_r(const char* name, struct passwd* pwd,
|
||||
char* buf, size_t buflen, struct passwd** result)
|
||||
{
|
||||
@@ -259,6 +260,7 @@ extern int prefix_getpwnam_r(const char* name, struct passwd* pwd,
|
||||
return getpwnam_r(name, pwd, buf, buflen, result);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
extern struct spwd *prefix_getspnam(const char* name)
|
||||
{
|
||||
if (spw_db_file) {
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
#define ARG_TYPE const char *
|
||||
#define ARG_NAME name
|
||||
#define DUP_FUNCTION __pw_dup
|
||||
#define HAVE_FUNCTION_R 1
|
||||
#define HAVE_FUNCTION_R HAVE_FGETPWENT_R
|
||||
|
||||
#include "xgetXXbyYY.c"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user