We don't use getpwuid() anymore (see commit
e757cdd6), so we don't need
locking around pg_get_user_name().
Reviewed-by: Andres Freund <andres@anarazel.de>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi>
Discussion: https://postgr.es/m/CA%2BhUKGLtmexrpMtxBRLCVePqV_dtWG-ZsEbyPrYc%2BNBB2TkNsw%40mail.gmail.com
char pwdbuf[BUFSIZ];
#endif
- /*
- * Some users are using configure --enable-thread-safety-force, so we
- * might as well do the locking within our library to protect getpwuid().
- * In fact, application developers can use getpwuid() in their application
- * if they use the locking call we provide, or install their own locking
- * function using PQregisterThreadLock().
- */
- pglock_thread();
-
#ifdef WIN32
if (GetUserName(username, &namesize))
name = username;
libpq_append_error(errorMessage, "out of memory");
}
- pgunlock_thread();
-
return result;
}