mirror of
https://github.com/postgres/postgres.git
synced 2025-08-28 18:48:04 +03:00
Remove configure test for nonstandard variants of getpwuid_r().
We had code that supposed that some platforms might offer a nonstandard version of getpwuid_r() with only four arguments. However, the 5-argument definition has been standardized at least since the Single Unix Spec v2, which is our normal reference for what's portable across all Unix-oid platforms. (What's more, this wasn't the only pre-standardization version of getpwuid_r(); my old HPUX 10.20 box has still another signature.) So let's just get rid of the now-useless configure step.
This commit is contained in:
@@ -82,7 +82,7 @@ pqStrerror(int errnum, char *strerrbuf, size_t buflen)
|
||||
|
||||
/*
|
||||
* Wrapper around getpwuid() or getpwuid_r() to mimic POSIX getpwuid_r()
|
||||
* behaviour, if it is not available or required.
|
||||
* behaviour, if that function is not available or required.
|
||||
*
|
||||
* Per POSIX, the possible cases are:
|
||||
* success: returns zero, *result is non-NULL
|
||||
@@ -96,21 +96,7 @@ pqGetpwuid(uid_t uid, struct passwd * resultbuf, char *buffer,
|
||||
size_t buflen, struct passwd ** result)
|
||||
{
|
||||
#if defined(FRONTEND) && defined(ENABLE_THREAD_SAFETY) && defined(HAVE_GETPWUID_R)
|
||||
|
||||
#ifdef GETPWUID_R_5ARG
|
||||
/* POSIX version */
|
||||
return getpwuid_r(uid, resultbuf, buffer, buflen, result);
|
||||
#else
|
||||
|
||||
/*
|
||||
* Early POSIX draft of getpwuid_r() returns 'struct passwd *'.
|
||||
* getpwuid_r(uid, resultbuf, buffer, buflen)
|
||||
*/
|
||||
errno = 0;
|
||||
*result = getpwuid_r(uid, resultbuf, buffer, buflen);
|
||||
/* paranoia: ensure we return zero on success */
|
||||
return (*result == NULL) ? errno : 0;
|
||||
#endif
|
||||
#else
|
||||
/* no getpwuid_r() available, just use getpwuid() */
|
||||
errno = 0;
|
||||
|
Reference in New Issue
Block a user