diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2015-11-12 13:14:08 +0100 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2015-11-12 13:15:52 +0100 |
commit | e5a1a9304a2efbb892df15eed195c14e3db24bfb (patch) | |
tree | e0a029e0627886075340df66e7911b4123bd594c /winsup/cygwin/flock.cc | |
parent | 569147ac286eca9ada778c1cf1a0963d67e8eb9c (diff) | |
download | newlib-cygwin-acl.zip newlib-cygwin-acl.tar.gz newlib-cygwin-acl.tar.bz2 |
flock: Fix hang in object collision casegithub/cygwin-aclcygwin-acl
* flock.cc (lockf_t::create_lock_obj): Correctly recreate lock object
attributes anew in each loop.
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/flock.cc')
-rw-r--r-- | winsup/cygwin/flock.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/flock.cc b/winsup/cygwin/flock.cc index 0ac5548..f7c04c8 100644 --- a/winsup/cygwin/flock.cc +++ b/winsup/cygwin/flock.cc @@ -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)) |