mirror of
https://github.com/postgres/postgres.git
synced 2025-07-23 03:21:12 +03:00
Pgindent run for 8.0.
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
*
|
||||
* Portions Copyright (c) 1996-2004, PostgreSQL Global Development Group
|
||||
*
|
||||
* $PostgreSQL: pgsql/src/port/thread.c,v 1.24 2004/08/29 04:13:12 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/port/thread.c,v 1.25 2004/08/29 05:07:02 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -36,12 +36,12 @@
|
||||
* Additional confusion exists because many operating systems that
|
||||
* use pthread_setspecific/pthread_getspecific() also have *_r versions
|
||||
* of standard library functions for compatibility with operating systems
|
||||
* that require them. However, internally, these *_r functions merely
|
||||
* that require them. However, internally, these *_r functions merely
|
||||
* call the thread-safe standard library functions.
|
||||
*
|
||||
* For example, BSD/OS 4.3 uses Bind 8.2.3 for getpwuid(). Internally,
|
||||
* getpwuid() calls pthread_setspecific/pthread_getspecific() to return
|
||||
* static data to the caller in a thread-safe manner. However, BSD/OS
|
||||
* static data to the caller in a thread-safe manner. However, BSD/OS
|
||||
* also has getpwuid_r(), which merely calls getpwuid() and shifts
|
||||
* around the arguments to match the getpwuid_r() function declaration.
|
||||
* Therefore, while BSD/OS has getpwuid_r(), it isn't required. It also
|
||||
@ -59,7 +59,7 @@
|
||||
* Run src/tools/thread to see if your operating system has thread-safe
|
||||
* non-*_r functions.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Wrapper around strerror and strerror_r to use the former if it is
|
||||
@ -94,8 +94,8 @@ pqStrerror(int errnum, char *strerrbuf, size_t buflen)
|
||||
*/
|
||||
#ifndef WIN32
|
||||
int
|
||||
pqGetpwuid(uid_t uid, struct passwd *resultbuf, char *buffer,
|
||||
size_t buflen, struct passwd **result)
|
||||
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)
|
||||
|
||||
@ -103,9 +103,10 @@ pqGetpwuid(uid_t uid, struct passwd *resultbuf, char *buffer,
|
||||
/* POSIX version */
|
||||
getpwuid_r(uid, resultbuf, buffer, buflen, result);
|
||||
#else
|
||||
|
||||
/*
|
||||
* Early POSIX draft of getpwuid_r() returns 'struct passwd *'.
|
||||
* getpwuid_r(uid, resultbuf, buffer, buflen)
|
||||
* getpwuid_r(uid, resultbuf, buffer, buflen)
|
||||
*/
|
||||
*result = getpwuid_r(uid, resultbuf, buffer, buflen);
|
||||
#endif
|
||||
@ -127,12 +128,13 @@ pqGetpwuid(uid_t uid, struct passwd *resultbuf, char *buffer,
|
||||
#ifndef HAVE_GETADDRINFO
|
||||
int
|
||||
pqGethostbyname(const char *name,
|
||||
struct hostent *resultbuf,
|
||||
struct hostent * resultbuf,
|
||||
char *buffer, size_t buflen,
|
||||
struct hostent **result,
|
||||
struct hostent ** result,
|
||||
int *herrno)
|
||||
{
|
||||
#if defined(FRONTEND) && defined(ENABLE_THREAD_SAFETY) && defined(HAVE_GETHOSTBYNAME_R)
|
||||
|
||||
/*
|
||||
* broken (well early POSIX draft) gethostbyname_r() which returns
|
||||
* 'struct hostent *'
|
||||
@ -147,11 +149,12 @@ pqGethostbyname(const char *name,
|
||||
|
||||
if (*result != NULL)
|
||||
*herrno = h_errno;
|
||||
|
||||
|
||||
if (*result != NULL)
|
||||
return 0;
|
||||
else
|
||||
return -1;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user