mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-21 00:07:36 +08:00
* 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>
|
||||
|
||||
* 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, '\\');
|
||||
if (!cp)
|
||||
goto error;
|
||||
return NULL;
|
||||
while (*++cp && *cp != '\\')
|
||||
;
|
||||
memcpy (root_path, full_path, (len = cp - full_path));
|
||||
rootp = root_path + len;
|
||||
}
|
||||
else
|
||||
{
|
||||
error:
|
||||
set_errno (ENOTDIR);
|
||||
return NULL;
|
||||
}
|
||||
return NULL;
|
||||
|
||||
*rootp++ = '\\';
|
||||
*rootp = '\0';
|
||||
|
@ -1727,7 +1727,10 @@ statvfs (const char *fname, struct statvfs *sfs)
|
||||
|
||||
path_conv full_path (fname, PC_SYM_FOLLOW);
|
||||
if (!rootdir (full_path, root))
|
||||
return -1;
|
||||
{
|
||||
set_errno (ENOTDIR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ULARGE_INTEGER availb, freeb, totalb;
|
||||
DWORD spc, bps, availc, freec, totalc, vsn, maxlen, flags;
|
||||
|
Loading…
x
Reference in New Issue
Block a user