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

commit df307349a09e6f1ba75c78b1427dcea40f435e6e
Author:     Corinna Vinschen <cori...@vinschen.de>
AuthorDate: Thu Feb 20 20:28:01 2025 +0100
Commit:     Corinna Vinschen <cori...@vinschen.de>
CommitDate: Thu Feb 20 20:28:01 2025 +0100

    Cygwin: fhandler_netdrive::exists: add debug statement
    
    Add a debug_printf printing the return code from GetAddrInfoW.
    
    Signed-off-by: Corinna Vinschen <cori...@vinschen.de>

Diff:
---
 winsup/cygwin/fhandler/netdrive.cc | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/winsup/cygwin/fhandler/netdrive.cc 
b/winsup/cygwin/fhandler/netdrive.cc
index f9412da2f0d3..dd27754c0a36 100644
--- a/winsup/cygwin/fhandler/netdrive.cc
+++ b/winsup/cygwin/fhandler/netdrive.cc
@@ -432,7 +432,7 @@ fhandler_netdrive::exists ()
   if (strlen (get_name ()) == 2)
     return virt_rootdir;
 
-  wchar_t name[MAX_PATH];
+  wchar_t name[CYG_MAX_PATH];
   struct addrinfoW *ai;
   INT ret;
   DWORD protocol = 0;
@@ -460,7 +460,10 @@ fhandler_netdrive::exists ()
   sys_mbstowcs (name, CYG_MAX_PATH, get_name ());
   ret = GetAddrInfoW (name + 2, NULL, NULL, &ai);
   if (!ret)
-    FreeAddrInfoW (ai);
+    {
+      debug_printf ("GetAddrInfoW(%W) returned %d", ret);
+      FreeAddrInfoW (ai);
+    }
 
   return ret ? virt_none : virt_directory;
 }

Reply via email to