OSDN Git Service

* fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Check specifically
authorcgf <cgf>
Sun, 2 Jun 2002 16:53:29 +0000 (16:53 +0000)
committercgf <cgf>
Sun, 2 Jun 2002 16:53:29 +0000 (16:53 +0000)
for non-existent file, first.
(fhandler_disk_file::fstat): Perform fd open on files with funny characters.

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

index cf4a6ff..2c3f10d 100644 (file)
@@ -1,3 +1,10 @@
+2002-06-02  Christopher Faylor  <cgf@redhat.com>
+
+       * fhandler_disk_file.cc (fhandler_disk_file::fstat_by_name): Check
+       specifically for non-existent file, first.
+       (fhandler_disk_file::fstat): Perform fd open on files with funny
+       characters.
+
 2002-06-02  Christopher January <chris@atomice.net>
 
        * fhandler_process.cc (fhandler_process::open): Set fileid.
index 463ae4a..c7c78ab 100644 (file)
@@ -102,7 +102,12 @@ fhandler_disk_file::fstat_by_name (struct __stat64 *buf, path_conv *pc)
   HANDLE handle;
   WIN32_FIND_DATA local;
 
-  if ((handle = FindFirstFile (pc->get_win32 (), &local)) == INVALID_HANDLE_VALUE)
+  if (!pc->exists ())
+    {
+      set_errno (ENOENT);
+      res = -1;
+    }
+  else if ((handle = FindFirstFile (pc->get_win32 (), &local)) == INVALID_HANDLE_VALUE)
     {
       __seterrno ();
       res = -1;
@@ -140,7 +145,8 @@ fhandler_disk_file::fstat (struct __stat64 *buf, path_conv *pc)
   else
     query_open_already = false;
 
-  if (query_open_already && strncasematch (pc->volname (), "FAT", 3))
+  if (query_open_already && strncasematch (pc->volname (), "FAT", 3)
+      && !strpbrk (get_win32_name (), "?*|<>|"))
     oret = 0;
   else if (!(oret = open (pc, open_flags, 0)))
     {