OSDN Git Service

2003-06-01 Pierre Humblet <pierre.humblet@ieee.org>
authorphumblet <phumblet>
Sun, 1 Jun 2003 19:37:13 +0000 (19:37 +0000)
committerphumblet <phumblet>
Sun, 1 Jun 2003 19:37:13 +0000 (19:37 +0000)
        * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Assume
        an existing directory is a root if FindFirstFile fails.

winsup/cygwin/ChangeLog
winsup/cygwin/fhandler_disk_file.cc

index a2049a2..b614335 100644 (file)
@@ -1,3 +1,8 @@
+2003-06-01  Pierre Humblet  <pierre.humblet@ieee.org>
+
+        * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Assume
+        an existing directory is a root if FindFirstFile fails.
+
 2003-05-30  Christopher Faylor  <cgf@redhat.com>
 
        * path.cc (mount_info::conv_to_win32_path): gcc warning about chroot_ok
index 30e6785..c595022 100644 (file)
@@ -108,18 +108,7 @@ fhandler_disk_file::fstat_by_name (struct __stat64 *buf, path_conv *pc)
       set_errno (ENOENT);
       res = -1;
     }
-  else if (pc->isdir () && strlen (*pc) <= strlen (pc->root_dir ()))
-    {
-      FILETIME ft = {};
-      res = fstat_helper (buf, pc, ft, ft, ft, 0, 0);
-    }
-  else if ((handle = FindFirstFile (*pc, &local)) == INVALID_HANDLE_VALUE)
-    {
-      debug_printf ("FindFirstFile failed for '%s', %E", (char *) *pc);
-      __seterrno ();
-      res = -1;
-    }
-  else
+  else if ((handle = FindFirstFile (*pc, &local)) != INVALID_HANDLE_VALUE)
     {
       FindClose (handle);
       res = fstat_helper (buf, pc,
@@ -129,6 +118,17 @@ fhandler_disk_file::fstat_by_name (struct __stat64 *buf, path_conv *pc)
                          local.nFileSizeHigh,
                          local.nFileSizeLow);
     }
+  else if (pc->isdir ())
+    {
+      FILETIME ft = {};
+      res = fstat_helper (buf, pc, ft, ft, ft, 0, 0);
+    }
+  else 
+    {
+      debug_printf ("FindFirstFile failed for '%s', %E", (char *) *pc);
+      __seterrno ();
+      res = -1;
+    }
   return res;
 }