* 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.
This commit is contained in:
Christopher Faylor 2002-05-31 03:11:21 +00:00
parent 81a0a3b440
commit 69be001cea
2 changed files with 16 additions and 1 deletions

View File

@ -1,3 +1,10 @@
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

View File

@ -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:\\";