diff options
author | Christopher Faylor <me@cgf.cx> | 2002-05-31 07:11:21 +0400 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2002-05-31 07:11:21 +0400 |
commit | 69be001ceaf6c17d42b0307d519c07c4a490e8d4 (patch) | |
tree | 4274165ce2da071f106e74a044888fcf4e165c3c /winsup | |
parent | 81a0a3b4405062a30fc67c377265a9c7a3999d04 (diff) |
* path.cc (path_conv::check): Set fileattr to INVALID_FILE_ATTRIBUTES for
nonexistent virtual device path.
(chdir): Set correct errno when attempt is made to cd to nonexistent virtual
device path.
Diffstat (limited to 'winsup')
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/path.cc | 10 |
2 files changed, 16 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f3ccf013e..ee7c10d33 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,12 @@ 2002-05-30 Christopher Faylor <cgf@redhat.com> + * path.cc (path_conv::check): Set fileattr to INVALID_FILE_ATTRIBUTES + for nonexistent virtual device path. + (chdir): Set correct errno when attempt is made to cd to nonexistent + virtual device path. + +2002-05-30 Christopher Faylor <cgf@redhat.com> + * fhandler_disk_file.cc (fhandler_disk_file::fstat): Always call fstat_by_name if fd is not opened to allow fstat_by_name to properly set errno. diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 722b51fbe..9aa968b78 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -536,9 +536,12 @@ path_conv::check (const char *src, unsigned opt, case 2: fileattr = FILE_ATTRIBUTE_DIRECTORY; break; - default: case -1: fileattr = 0; + break; + default: + fileattr = INVALID_FILE_ATTRIBUTES; + break; } delete fh; goto out; @@ -3304,6 +3307,11 @@ chdir (const char *in_dir) int devn = path.get_devn(); if (!isvirtual_dev (devn)) res = SetCurrentDirectory (native_dir) ? 0 : -1; + else if (!path.exists ()) + { + set_errno (ENOENT); + return -1; + } else { native_dir = "c:\\"; |