* passwd.cc (read_etc_passwd): Bother with unlocking when not in cygwin

initialization.
* grp.cc (read_etc_group): Ditto.
This commit is contained in:
Christopher Faylor
2001-09-28 07:23:18 +00:00
parent 8b51edbfa6
commit 1795c53d86
3 changed files with 16 additions and 0 deletions

View File

@@ -115,6 +115,11 @@ class passwd_lock
public:
passwd_lock (): mutex ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER) {}
void arm () {pthread_mutex_lock (&mutex); }
~passwd_lock ()
{
if (mutex != (pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)
pthread_mutex_unlock (&mutex);
}
};
/* Read in /etc/passwd and save contents in the password cache.