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
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2014-08-27 13:39:44 +0400
committerCorinna Vinschen <corinna@vinschen.de>2014-08-27 13:39:44 +0400
commitdb1ff3b932fba5679de5580ffb26fb1949456456 (patch)
tree7f0bdeb4e468a1f5ccd30ae0eaa128e39ed93ec4 /winsup/cygwin/ntea.cc
parentdc847e6b9e61475d5db1bea0b6df0857924837a4 (diff)
* ntea.cc (read_ea): Change left-over return to __leave. Fix
condition to close handle. Call NtClose rather than CloseHandle. (write_ea): Fix condition to close handle. Call NtClose rather than CloseHandle. * security.cc (get_file_sd): Call pc.init_reopen_attr if a valid incoming handle was given, pc.get_object_attr otherwise. (set_file_sd): Ditto.
Diffstat (limited to 'winsup/cygwin/ntea.cc')
-rw-r--r--winsup/cygwin/ntea.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/winsup/cygwin/ntea.cc b/winsup/cygwin/ntea.cc
index b5851c410..9e18fa77d 100644
--- a/winsup/cygwin/ntea.cc
+++ b/winsup/cygwin/ntea.cc
@@ -101,7 +101,7 @@ read_ea (HANDLE hdl, path_conv &pc, const char *name, char *value, size_t size)
if ((nlen = strlen (name)) >= MAX_EA_NAME_LEN)
{
set_errno (EINVAL);
- return -1;
+ __leave;
}
glen = sizeof (FILE_GET_EA_INFORMATION) + nlen;
gea = (PFILE_GET_EA_INFORMATION) alloca (glen);
@@ -225,8 +225,8 @@ read_ea (HANDLE hdl, path_conv &pc, const char *name, char *value, size_t size)
}
__except (EFAULT) {}
__endtry
- if (!hdl)
- CloseHandle (h);
+ if (!hdl && h)
+ NtClose (h);
debug_printf ("%d = read_ea(%S, %s, %p, %lu)",
ret, attr.ObjectName, name, value, size);
return ret;
@@ -360,8 +360,8 @@ write_ea (HANDLE hdl, path_conv &pc, const char *name, const char *value,
}
__except (EFAULT) {}
__endtry
- if (!hdl)
- CloseHandle (h);
+ if (!hdl && h)
+ NtClose (h);
debug_printf ("%d = write_ea(%S, %s, %p, %lu, %d)",
ret, attr.ObjectName, name, value, size, flags);
return ret;