aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-06-02 16:53:29 +0000
committerChristopher Faylor <me@cgf.cx>2002-06-02 16:53:29 +0000
commit97478fe6b48cf652434119911dc6caf8e07a603d (patch)
tree055a754672f16f70f404366f30a2ba2f868411a3
parent47413f8473f7def5e11fe2c4fc26aae76cf766b6 (diff)
downloadnewlib-97478fe6b48cf652434119911dc6caf8e07a603d.zip
newlib-97478fe6b48cf652434119911dc6caf8e07a603d.tar.gz
newlib-97478fe6b48cf652434119911dc6caf8e07a603d.tar.bz2
* 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.
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc10
2 files changed, 15 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index cf4a6ff..2c3f10d 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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.
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index 463ae4a..c7c78ab 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)))
{