* 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

@@ -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 */