From 1795c53d86d904ea683b602260830c1caa1bca97 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 28 Sep 2001 07:23:18 +0000 Subject: * passwd.cc (read_etc_passwd): Bother with unlocking when not in cygwin initialization. * grp.cc (read_etc_group): Ditto. --- winsup/cygwin/grp.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'winsup/cygwin/grp.cc') 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 */ -- cgit v1.2.3