Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2012-02-20 18:08:37 +0400
committerCorinna Vinschen <corinna@vinschen.de>2012-02-20 18:08:37 +0400
commit3c53eaeb5b32bfcb3e5a650f9ef9fa5c9e176b1e (patch)
tree1f6a9a0277e9d9177d7c2461ce3660099643e758 /winsup
parent2196614e3df4433c43c44eb44b75c65af021089d (diff)
* flock.cc (inode_t::del_my_locks): Drop useless counter lc. Close
lock object handle explicitely in case of called during fork. Add comment to explain why. * fork.cc (frok::child): Drop declaration of fixup_lockf_after_fork.
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/flock.cc10
-rw-r--r--winsup/cygwin/fork.cc3
3 files changed, 15 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 37a0a4649..d4118aba6 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2012-02-20 Corinna Vinschen <corinna@vinschen.de>
+
+ * flock.cc (inode_t::del_my_locks): Drop useless counter lc. Close
+ lock object handle explicitely in case of called during fork. Add
+ comment to explain why.
+ * fork.cc (frok::child): Drop declaration of fixup_lockf_after_fork.
+
2012-02-17 Corinna Vinschen <corinna@vinschen.de>
* timer.cc (getitimer): Don't create another local ret variable in
diff --git a/winsup/cygwin/flock.cc b/winsup/cygwin/flock.cc
index 9b1de01a9..16233449e 100644
--- a/winsup/cygwin/flock.cc
+++ b/winsup/cygwin/flock.cc
@@ -1,6 +1,6 @@
/* flock.cc. NT specific implementation of advisory file locking.
- Copyright 2003, 2008, 2009, 2010, 2011 Red Hat, Inc.
+ Copyright 2003, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
This file is part of Cygwin.
@@ -347,14 +347,18 @@ inode_t::del_my_locks (long long id, HANDLE fhdl)
{
lockf_t *lock, *n_lock;
lockf_t **prev = &i_lockf;
- int lc = 0;
for (lock = *prev; lock && (n_lock = lock->lf_next, 1); lock = n_lock)
{
if (lock->lf_flags & F_POSIX)
{
/* Delete all POSIX locks. */
*prev = n_lock;
- ++lc;
+ /* When called during fork, the POSIX lock must get deleted but
+ *not* signalled. The lock is still active and locked in the
+ parent. So in case of fork, we call close_lock_obj explicitely,
+ since del_lock_obj is called from the destructor. */
+ if (!id)
+ lock->close_lock_obj ();
delete lock;
}
else if (id && lock->lf_id == id)
diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc
index 313e0da59..56ba0fc0f 100644
--- a/winsup/cygwin/fork.cc
+++ b/winsup/cygwin/fork.cc
@@ -1,7 +1,7 @@
/* fork.cc
Copyright 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006,
- 2007, 2008, 2009, 2010, 2011 Red Hat, Inc.
+ 2007, 2008, 2009, 2010, 2011, 2012 Red Hat, Inc.
This file is part of Cygwin.
@@ -190,7 +190,6 @@ int __stdcall
frok::child (volatile char * volatile here)
{
HANDLE& hParent = ch.parent;
- extern void fixup_lockf_after_fork ();
extern void fixup_hooks_after_fork ();
extern void fixup_timers_after_fork ();