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>2020-01-29 17:14:05 +0300
committerCorinna Vinschen <corinna@vinschen.de>2020-01-29 17:14:05 +0300
commitf36262d56ac78f04de147746ce4a85c6155e4a23 (patch)
treea49836ad4aba6c6339130966afcd2249ae1a627d
parent13bfb3c63f35d875c1771daea6de4be0176e3b13 (diff)
Cygwin: stat: fix st_mode of fifos
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
-rw-r--r--winsup/cygwin/fhandler_disk_file.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index be45ad77a..f362e31e3 100644
--- a/winsup/cygwin/fhandler_disk_file.cc
+++ b/winsup/cygwin/fhandler_disk_file.cc
@@ -480,7 +480,7 @@ fhandler_base::fstat_helper (struct stat *buf)
{
/* If read-only attribute is set, modify ntsec return value */
if (::has_attribute (attributes, FILE_ATTRIBUTE_READONLY)
- && !pc.isdir () && !pc.issymlink ())
+ && !pc.isdir () && !pc.issymlink () && !pc.is_fs_special ())
buf->st_mode &= ~(S_IWUSR | S_IWGRP | S_IWOTH);
if (buf->st_mode & S_IFMT)
@@ -490,7 +490,7 @@ fhandler_base::fstat_helper (struct stat *buf)
else
{
buf->st_dev = buf->st_rdev = dev ();
- buf->st_mode = dev ().mode ();
+ buf->st_mode |= dev ().mode () & S_IFMT;
buf->st_size = 0;
}
}