diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2015-01-11 12:52:37 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2015-01-11 12:52:37 -0500 |
commit | 8883bae33b55a52105b1b58d0e42c5a6bda09627 (patch) | |
tree | 38347301a5059dd9557cac21d1f60ff386453fba /src | |
parent | 080eabe2e8a184ff40b7380aaaa9418714acace9 (diff) | |
download | postgresql-8883bae33b55a52105b1b58d0e42c5a6bda09627.tar.gz postgresql-8883bae33b55a52105b1b58d0e42c5a6bda09627.zip |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/include/pg_config.h.in | 3 | ||||
-rw-r--r-- | src/include/pg_config.h.win32 | 3 | ||||
-rw-r--r-- | src/port/thread.c | 16 |
3 files changed, 1 insertions, 21 deletions
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in index 83f04e93821..995fb65205c 100644 --- a/src/include/pg_config.h.in +++ b/src/include/pg_config.h.in @@ -74,9 +74,6 @@ reference if 'false' */ #undef FLOAT8PASSBYVAL -/* Define to 1 if getpwuid_r() takes a 5th argument. */ -#undef GETPWUID_R_5ARG - /* Define to 1 if gettimeofday() takes only 1 argument. */ #undef GETTIMEOFDAY_1ARG diff --git a/src/include/pg_config.h.win32 b/src/include/pg_config.h.win32 index 05941e65774..69d0e31a071 100644 --- a/src/include/pg_config.h.win32 +++ b/src/include/pg_config.h.win32 @@ -62,9 +62,6 @@ (--enable-thread-safety) */ #define ENABLE_THREAD_SAFETY 1 -/* Define to 1 if getpwuid_r() takes a 5th argument. */ -/* #undef GETPWUID_R_5ARG */ - /* Define to 1 if gettimeofday() takes only 1 argument. */ /* #undef GETTIMEOFDAY_1ARG */ diff --git a/src/port/thread.c b/src/port/thread.c index aab74516ac9..c1295cfc1f6 100644 --- a/src/port/thread.c +++ b/src/port/thread.c @@ -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,22 +96,8 @@ 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; *result = getpwuid(uid); |