From e148aa62a79619b102c394029d170d22198542ea Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Mon, 28 Jan 2019 10:23:59 +0100 Subject: Cygwin: procfd: improve debug output Signed-off-by: Corinna Vinschen --- winsup/cygwin/fhandler.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc index 9643373b0..07a048208 100644 --- a/winsup/cygwin/fhandler.cc +++ b/winsup/cygwin/fhandler.cc @@ -547,7 +547,8 @@ fhandler_base::open (int flags, mode_t mode) PFILE_FULL_EA_INFORMATION p = NULL; ULONG plen = 0; - syscall_printf ("(%S, %y)", pc.get_nt_native_path (), flags); + syscall_printf ("(%S, %y)%s", pc.get_nt_native_path (), flags, + get_handle () ? " by handle" : ""); if (flags & O_PATH) query_open (query_read_attributes); @@ -559,6 +560,8 @@ fhandler_base::open (int flags, mode_t mode) pc.init_reopen_attr (attr, get_handle ()); if (!(flags & O_CLOEXEC)) attr.Attributes |= OBJ_INHERIT; + if (pc.has_buggy_reopen ()) + debug_printf ("Reopen by handle requested but FS doesn't support it"); } else pc.get_object_attr (attr, *sec_none_cloexec (flags)); @@ -693,7 +696,7 @@ fhandler_base::open (int flags, mode_t mode) status = NtCreateFile (&fh, access, &attr, &io, NULL, file_attributes, shared, create_disposition, options, p, plen); - /* Pre-W10, we can't open a file by handle with delete disposition + /* Pre-W10, we can't reopen a file by handle with delete disposition set, so we have to lie our ass off. */ if (get_handle () && status == STATUS_DELETE_PENDING) { -- cgit v1.2.3