public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: stat: fix st_mode of fifos
@ 2020-01-29 14:14 Corinna Vinschen
0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2020-01-29 14:14 UTC (permalink / raw)
To: cygwin-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=f36262d56ac78f04de147746ce4a85c6155e4a23
commit f36262d56ac78f04de147746ce4a85c6155e4a23
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Wed Jan 29 15:14:05 2020 +0100
Cygwin: stat: fix st_mode of fifos
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
winsup/cygwin/fhandler_disk_file.cc | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/winsup/cygwin/fhandler_disk_file.cc b/winsup/cygwin/fhandler_disk_file.cc
index be45ad7..f362e31 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;
}
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-01-29 14:14 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-29 14:14 [newlib-cygwin] Cygwin: stat: fix st_mode of fifos Corinna Vinschen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).