diff options
author | Christopher Faylor <me@cgf.cx> | 2001-06-26 14:47:48 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-06-26 14:47:48 +0000 |
commit | 462f4effb11d00114b8285a991a3257d36db308a (patch) | |
tree | d0d3ddcf619a0697858620d9c0bd84a95aeceb0b /winsup/cygwin/passwd.cc | |
parent | d006404dae50c0fe1ce5c55f12d8eb8c28ff6625 (diff) | |
download | cygnal-462f4effb11d00114b8285a991a3257d36db308a.tar.gz cygnal-462f4effb11d00114b8285a991a3257d36db308a.tar.bz2 cygnal-462f4effb11d00114b8285a991a3257d36db308a.zip |
* mmap.cc: Clean up *ResourceLock calls throughout.
* thread.cc (pthread_cond::TimedWait): Check for WAIT_TIMEOUT as well as
WAIT_ABANDONED.
(__pthread_cond_timedwait): Calculate a relative wait from the abstime
parameter.
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; |