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-05-15 01:12:10 +0400
committerCorinna Vinschen <corinna@vinschen.de>2005-05-15 01:12:10 +0400
commitdad546a5ebf3b21179e2e1d9574f972112d39d9c (patch)
tree4e9a0a1259b5e36951cc0f9c23013b2e731b6ba5 /winsup/cygwin
parent6dd9ec6c589d9b75cae74046d2a1e0e1c59b950f (diff)
* fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Check
return code from GetFileSize and set file size to 0 if necessary. * fhandler_netdrive.cc (fhandler_netdrive::fstat): Set permissions to read/execute for all.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc7
-rw-r--r--winsup/cygwin/fhandler_netdrive.cc2
3 files changed, 14 insertions, 2 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 411d98d63..9db75a9ab 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2005-05-14 Corinna Vinschen <corinna@vinschen.de>
+
+ * fhandler_disk_file.cc (fhandler_base::fstat_by_handle): Check
+ return code from GetFileSize and set file size to 0 if necessary.
+ * fhandler_netdrive.cc (fhandler_netdrive::fstat): Set permissions
+ to read/execute for all.
+
2005-05-13 Christopher Faylor <cgf@timesys.com>
* path.cc (normalize_posix_path): Do normalization on . and .. after
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index ff14a053a..ca9f1fab3 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -148,11 +148,16 @@ fhandler_base::fstat_by_handle (struct __stat64 *buf)
BOOL res = GetFileInformationByHandle (get_handle (), &local);
debug_printf ("%d = GetFileInformationByHandle (%s, %d)",
res, get_win32_name (), get_handle ());
- /* GetFileInformationByHandle will fail if it's given stdio handle or pipe*/
+ /* GetFileInformationByHandle will fail if it's given stdio handle or pipe.
+ It also fails on 9x when trying to access directories on shares. */
if (!res)
{
memset (&local, 0, sizeof (local));
local.nFileSizeLow = GetFileSize (get_handle (), &local.nFileSizeHigh);
+ /* Even GetFileSize fails on 9x when trying to access directories
+ on shares. In this case reset filesize to 0. */
+ if (local.nFileSizeLow == 0xffffffff && GetLastError ())
+ local.nFileSizeLow = 0;
}
return fstat_helper (buf,
diff --git a/winsup/cygwin/fhandler_netdrive.cc b/winsup/cygwin/fhandler_netdrive.cc
index 58129cfc2..b1a6e8926 100644
--- a/winsup/cygwin/fhandler_netdrive.cc
+++ b/winsup/cygwin/fhandler_netdrive.cc
@@ -65,7 +65,7 @@ fhandler_netdrive::fstat (struct __stat64 *buf)
(void) fhandler_base::fstat (buf);
- buf->st_mode = S_IFDIR | S_IXUSR | S_IXGRP | S_IXOTH;
+ buf->st_mode = S_IFDIR | STD_RBITS | STD_XBITS;
return 0;
}