From 3b12a57cb6575f24443931871ed169c54a802df5 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Fri, 24 Jun 2005 09:12:15 +0000 Subject: [PATCH] * fhandler.cc (rootdir): Don't set errno. * syscalls.cc (statvfs): Set errno to ENOTDIR if rootdir() failed. --- winsup/cygwin/ChangeLog | 5 +++++ winsup/cygwin/fhandler.cc | 8 ++------ winsup/cygwin/syscalls.cc | 5 ++++- 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 + + * fhandler.cc (rootdir): Don't set errno. + * syscalls.cc (statvfs): Set errno to ENOTDIR if rootdir() failed. + 2005-06-22 Corinna Vinschen * 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;