diff options
author | Christopher Faylor <me@cgf.cx> | 2001-09-28 11:23:18 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2001-09-28 11:23:18 +0400 |
commit | 1795c53d86d904ea683b602260830c1caa1bca97 (patch) | |
tree | 785ae58baf5a7262a45ca53a3a26a86f7a3954bb /winsup/cygwin/grp.cc | |
parent | 8b51edbfa6c8f372f9ce68c7edad0046b71ce1fd (diff) |
* passwd.cc (read_etc_passwd): Bother with unlocking when not in cygwin
initialization.
* grp.cc (read_etc_group): Ditto.
Diffstat (limited to 'winsup/cygwin/grp.cc')
-rw-r--r-- | winsup/cygwin/grp.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc index e4a4afd6c..d9e7b02b4 100644 --- a/winsup/cygwin/grp.cc +++ b/winsup/cygwin/grp.cc @@ -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 */ |