* fhandler.cc (rootdir): Don't set errno.
* syscalls.cc (statvfs): Set errno to ENOTDIR if rootdir() failed.
This commit is contained in:
parent
6bfab24ef3
commit
3b12a57cb6
|
@ -1,3 +1,8 @@
|
||||||
|
2005-06-24 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
|
* fhandler.cc (rootdir): Don't set errno.
|
||||||
|
* syscalls.cc (statvfs): Set errno to ENOTDIR if rootdir() failed.
|
||||||
|
|
||||||
2005-06-22 Corinna Vinschen <corinna@vinschen.de>
|
2005-06-22 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* fhandler.h (class fhandler_dev_tape): Add declaration for
|
* fhandler.h (class fhandler_dev_tape): Add declaration for
|
||||||
|
|
|
@ -1179,18 +1179,14 @@ rootdir (const char *full_path, char *root_path)
|
||||||
{
|
{
|
||||||
const char *cp = strchr (full_path + 2, '\\');
|
const char *cp = strchr (full_path + 2, '\\');
|
||||||
if (!cp)
|
if (!cp)
|
||||||
goto error;
|
return NULL;
|
||||||
while (*++cp && *cp != '\\')
|
while (*++cp && *cp != '\\')
|
||||||
;
|
;
|
||||||
memcpy (root_path, full_path, (len = cp - full_path));
|
memcpy (root_path, full_path, (len = cp - full_path));
|
||||||
rootp = root_path + len;
|
rootp = root_path + len;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
|
||||||
error:
|
|
||||||
set_errno (ENOTDIR);
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
|
||||||
|
|
||||||
*rootp++ = '\\';
|
*rootp++ = '\\';
|
||||||
*rootp = '\0';
|
*rootp = '\0';
|
||||||
|
|
|
@ -1727,7 +1727,10 @@ statvfs (const char *fname, struct statvfs *sfs)
|
||||||
|
|
||||||
path_conv full_path (fname, PC_SYM_FOLLOW);
|
path_conv full_path (fname, PC_SYM_FOLLOW);
|
||||||
if (!rootdir (full_path, root))
|
if (!rootdir (full_path, root))
|
||||||
|
{
|
||||||
|
set_errno (ENOTDIR);
|
||||||
return -1;
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
ULARGE_INTEGER availb, freeb, totalb;
|
ULARGE_INTEGER availb, freeb, totalb;
|
||||||
DWORD spc, bps, availc, freec, totalc, vsn, maxlen, flags;
|
DWORD spc, bps, availc, freec, totalc, vsn, maxlen, flags;
|
||||||
|
|
Loading…
Reference in New Issue