* flock.cc (fhandler_disk_file::lock): Disable a shortcut from the

original BSD code, but keep it in and documented why we can't use it.
This commit is contained in:
Corinna Vinschen 2009-11-18 20:05:46 +00:00
parent b425cbf482
commit 9fa63f7a5e
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2009-11-18 Corinna Vinschen <corinna@vinschen.de>
* flock.cc (fhandler_disk_file::lock): Disable a shortcut from the
original BSD code, but keep it in and documented why we can't use it.
2009-11-18 Corinna Vinschen <corinna@vinschen.de>
* ntea.cc (read_ea): Always add length of "user." prefix, not only

View File

@ -767,8 +767,13 @@ fhandler_disk_file::lock (int a_op, struct __flock64 *fl)
lockf_t **head = &node->i_lockf;
#if 0
/*
* Avoid the common case of unlocking when inode_t has no locks.
*
* This shortcut is invalid for Cygwin because the above inode_t::get
* call returns with an empty lock list if this process has no locks
* on the file yet.
*/
if (*head == NULL)
{
@ -779,6 +784,7 @@ fhandler_disk_file::lock (int a_op, struct __flock64 *fl)
return 0;
}
}
#endif
/*
* Allocate a spare structure in case we have to split.
*/