* passwd.cc (read_etc_passwd): Bother with unlocking when not in cygwin
initialization. * grp.cc (read_etc_group): Ditto.
This commit is contained in:
parent
8b51edbfa6
commit
1795c53d86
|
@ -1,3 +1,9 @@
|
|||
Fri Sep 28 03:23:04 2001 Christopher Faylor <cgf@cygnus.com>
|
||||
|
||||
* passwd.cc (read_etc_passwd): Bother with unlocking when not
|
||||
in cygwin initialization.
|
||||
* grp.cc (read_etc_group): Ditto.
|
||||
|
||||
Fri Sep 28 02:57:03 2001 Christopher Faylor <cgf@cygnus.com>
|
||||
|
||||
* passwd.cc (read_etc_passwd): Don't bother with locking when
|
||||
|
|
|
@ -123,6 +123,11 @@ class group_lock
|
|||
public:
|
||||
group_lock (): mutex ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER) {}
|
||||
void arm () {pthread_mutex_lock (&mutex); }
|
||||
~group_lock ()
|
||||
{
|
||||
if (mutex != (pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)
|
||||
pthread_mutex_unlock (&mutex);
|
||||
}
|
||||
};
|
||||
|
||||
/* Cygwin internal */
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue