flock: Fix hang in object collision case

* flock.cc (lockf_t::create_lock_obj): Correctly recreate lock object
	attributes anew in each loop.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen
2015-11-12 13:14:08 +01:00
parent e6459123e4
commit 914620a7e6
3 changed files with 12 additions and 2 deletions

View File

@ -766,12 +766,12 @@ lockf_t::create_lock_obj ()
{
lockfattr_t attr;
NTSTATUS status;
PSECURITY_DESCRIPTOR sd_buf = alloca (SD_MIN_SIZE);
POBJECT_ATTRIBUTES lock_obj_attr;
lock_obj_attr = create_lock_obj_attr (&attr, OBJ_INHERIT,
alloca (SD_MIN_SIZE));
do
{
lock_obj_attr = create_lock_obj_attr (&attr, OBJ_INHERIT, sd_buf);
status = NtCreateEvent (&lf_obj, CYG_EVENT_ACCESS, lock_obj_attr,
NotificationEvent, FALSE);
if (!NT_SUCCESS (status))