Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2005-06-24 13:12:15 +0400
committerCorinna Vinschen <corinna@vinschen.de>2005-06-24 13:12:15 +0400
commit3b12a57cb6575f24443931871ed169c54a802df5 (patch)
tree3bb649f5b9317ea1798afefce2daeecea570c022
parent6bfab24ef3c77d7f3d59a144456fb60f61527994 (diff)
* fhandler.cc (rootdir): Don't set errno.
* syscalls.cc (statvfs): Set errno to ENOTDIR if rootdir() failed.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/fhandler.cc8
-rw-r--r--winsup/cygwin/syscalls.cc5
3 files changed, 11 insertions, 7 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 6f7c84021..b677111f4 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -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
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index c5074a3fe..2f034007a 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -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';
diff --git a/winsup/cygwin/syscalls.cc b/winsup/cygwin/syscalls.cc
index e5bd72c13..3f50a7b99 100644
--- a/winsup/cygwin/syscalls.cc
+++ b/winsup/cygwin/syscalls.cc
@@ -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;