[newlib-cygwin] Cygwin: procfd: improve debug output

Corinna Vinschen corinna@sourceware.org
Mon Jan 28 09:24:00 GMT 2019


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=e148aa62a79619b102c394029d170d22198542ea

commit e148aa62a79619b102c394029d170d22198542ea
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Mon Jan 28 10:23:59 2019 +0100

    Cygwin: procfd: improve debug output
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 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 9643373..07a0482 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)
     {



More information about the Cygwin-cvs mailing list