diff options
Diffstat (limited to 'winsup/cygwin/passwd.cc')
-rw-r--r-- | winsup/cygwin/passwd.cc | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/winsup/cygwin/passwd.cc b/winsup/cygwin/passwd.cc index 7c214987c..c417e34fd 100644 --- a/winsup/cygwin/passwd.cc +++ b/winsup/cygwin/passwd.cc @@ -133,8 +133,8 @@ read_etc_passwd () /* if we got blocked by the mutex, then etc_passwd may have been processed */ if (passwd_state != uninitialized) { - pthread_mutex_unlock(&etc_passwd_mutex); - return; + pthread_mutex_unlock(&etc_passwd_mutex); + return; } if (passwd_state != initializing) @@ -206,13 +206,13 @@ getpwuid (uid_t uid) { if (passwd_state <= initializing) read_etc_passwd (); - + pthread_testcancel(); return search_for (uid, 0); } -extern "C" int +extern "C" int getpwuid_r (uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize, struct passwd **result) { *result = NULL; @@ -232,7 +232,7 @@ getpwuid_r (uid_t uid, struct passwd *pwd, char *buffer, size_t bufsize, struct /* check needed buffer size. */ size_t needsize = strlen (temppw->pw_name) + strlen (temppw->pw_dir) + - strlen (temppw->pw_shell) + strlen (temppw->pw_gecos) + + strlen (temppw->pw_shell) + strlen (temppw->pw_gecos) + strlen (temppw->pw_passwd) + 5; if (needsize > bufsize) return ERANGE; @@ -259,14 +259,14 @@ getpwnam (const char *name) { if (passwd_state <= initializing) read_etc_passwd (); - + pthread_testcancel(); return search_for (0, name); } -/* the max size buffer we can expect to +/* the max size buffer we can expect to * use is returned via sysconf with _SC_GETPW_R_SIZE_MAX. * This may need updating! - Rob Collins April 2001. */ @@ -290,11 +290,11 @@ getpwnam_r (const char *nam, struct passwd *pwd, char *buffer, size_t bufsize, s /* check needed buffer size. */ size_t needsize = strlen (temppw->pw_name) + strlen (temppw->pw_dir) + - strlen (temppw->pw_shell) + strlen (temppw->pw_gecos) + + strlen (temppw->pw_shell) + strlen (temppw->pw_gecos) + strlen (temppw->pw_passwd) + 5; if (needsize > bufsize) return ERANGE; - + /* make a copy of temppw */ *result = pwd; pwd->pw_uid = temppw->pw_uid; |