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:
Diffstat (limited to 'winsup/cygwin/fhandler_disk_file.cc')
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index 02ce90e61..1d7675c34 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -118,7 +118,7 @@ public:
{
found[__DIR_PROC] = true;
if (retname)
- RtlInitUnicodeString (retname, L"proc");
+ *retname = ro_u_proc;
return 2;
}
if (!found[__DIR_CYGDRIVE])
@@ -407,7 +407,9 @@ fhandler_base::fstat_by_handle (struct __stat64 *buf)
entry, as in other calls to fstat_helper. */
if (pc.is_rep_symlink ())
fi.fbi.FileAttributes &= ~FILE_ATTRIBUTE_DIRECTORY;
- pc.file_attributes (fi.fbi.FileAttributes);
+ /* Only copy attributes if not a device root dir. */
+ if (!(pc.file_attributes () & FILE_ATTRIBUTE_DEVICE))
+ pc.file_attributes (fi.fbi.FileAttributes);
return fstat_helper (buf,
fi.fbi.ChangeTime.QuadPart ? &fi.fbi.ChangeTime
: &fi.fbi.LastWriteTime,
@@ -474,7 +476,9 @@ fhandler_base::fstat_by_name (struct __stat64 *buf)
entry, as in other calls to fstat_helper. */
if (pc.is_rep_symlink ())
fdi_buf.fdi.FileAttributes &= ~FILE_ATTRIBUTE_DIRECTORY;
- pc.file_attributes (fdi_buf.fdi.FileAttributes);
+ /* Only copy attributes if not a device root dir. */
+ if (!(pc.file_attributes () & FILE_ATTRIBUTE_DEVICE))
+ pc.file_attributes (fdi_buf.fdi.FileAttributes);
return fstat_helper (buf,
fdi_buf.fdi.ChangeTime.QuadPart
? &fdi_buf.fdi.ChangeTime : &fdi_buf.fdi.LastWriteTime,