diff options
author | Pierre Humblet <phumblet@phumblet.no-ip.org> | 2003-06-01 19:37:13 +0000 |
---|---|---|
committer | Pierre Humblet <phumblet@phumblet.no-ip.org> | 2003-06-01 19:37:13 +0000 |
commit | c17e8306d06f795755b751fa8c0021c16d34fa25 (patch) | |
tree | 21a1fbca86dab1d297cf91442f1a1c9f0fc7f6e5 /winsup/cygwin/fhandler_disk_file.cc | |
parent | e59c6ff448d40938f4f09042d6689d7d1aa655fe (diff) | |
download | cygnal-c17e8306d06f795755b751fa8c0021c16d34fa25.tar.gz cygnal-c17e8306d06f795755b751fa8c0021c16d34fa25.tar.bz2 cygnal-c17e8306d06f795755b751fa8c0021c16d34fa25.zip |
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.
Diffstat (limited to 'winsup/cygwin/fhandler_disk_file.cc')
-rw-r--r-- | winsup/cygwin/fhandler_disk_file.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc index 30e6785bb..c595022f7 100644 --- a/winsup/cygwin/fhandler_disk_file.cc +++ b/winsup/cygwin/fhandler_disk_file.cc @@ -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; } |