Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-06-02 20:53:29 +0400
committerChristopher Faylor <me@cgf.cx>2002-06-02 20:53:29 +0400
commit97478fe6b48cf652434119911dc6caf8e07a603d (patch)
tree055a754672f16f70f404366f30a2ba2f868411a3 /winsup/cygwin/fhandler_disk_file.cc
parent47413f8473f7def5e11fe2c4fc26aae76cf766b6 (diff)
* 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.
Diffstat (limited to 'winsup/cygwin/fhandler_disk_file.cc')
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc10
1 files changed, 8 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index 463ae4af3..c7c78ab34 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -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)))
{