From f45c299dbe093359db1f9bf4e06daa5129a17f16 Mon Sep 17 00:00:00 2001
From: Christopher Faylor <me@cgf.cx>
Date: Tue, 5 Apr 2005 04:48:02 +0000
Subject: [PATCH] * sync.h (muto::initforce): Force initialization even when
 name != NULL. * grp.cc (pwdgrp::pwdgrp): Use initforce since the enclosing
 structure is !NO_COPY.

---
 winsup/cygwin/ChangeLog | 7 +++++++
 winsup/cygwin/grp.cc    | 4 ++--
 winsup/cygwin/sync.h    | 1 +
 3 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index c5b3c610c..212fe89a3 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2005-04-05  Christopher Faylor  <cgf@timesys.com>
+
+	* sync.h (muto::initforce): Force initialization even when name !=
+	NULL.
+	* grp.cc (pwdgrp::pwdgrp): Use initforce since the enclosing structure
+	is !NO_COPY.
+
 2005-04-05  Christopher Faylor  <cgf@timesys.com>
 
 	* sync.h (muto::operator int): New operator.
diff --git a/winsup/cygwin/grp.cc b/winsup/cygwin/grp.cc
index 5f45a31b3..190d9cb26 100644
--- a/winsup/cygwin/grp.cc
+++ b/winsup/cygwin/grp.cc
@@ -111,7 +111,7 @@ pwdgrp::pwdgrp (passwd *&pbuf) :
 {
   read = &pwdgrp::read_passwd;
   parse = &pwdgrp::parse_passwd;
-  pglock.init ("pwd_lock");
+  pglock.initforce ("pwd_lock");
 }
 
 pwdgrp::pwdgrp (__group32 *&gbuf) :
@@ -119,7 +119,7 @@ pwdgrp::pwdgrp (__group32 *&gbuf) :
 {
   read = &pwdgrp::read_group;
   parse = &pwdgrp::parse_group;
-  pglock.init ("grp_lock");
+  pglock.initforce ("grp_lock");
 }
 
 struct __group32 *
diff --git a/winsup/cygwin/sync.h b/winsup/cygwin/sync.h
index 441892a08..13fa33caf 100644
--- a/winsup/cygwin/sync.h
+++ b/winsup/cygwin/sync.h
@@ -28,6 +28,7 @@ public:
   void *tls;	/* Tls of lock owner. */
   // class muto *next;
 
+  muto *initforce (const char *s) {name = NULL; return init (s);}
   /* The real constructor. */
   muto *init (const char *) __attribute__ ((regparm (2)));