public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin/cygwin-3_3-branch] Cygwin: fsync: Return EINVAL for special files.
@ 2022-03-14 10:39 Takashi Yano
  0 siblings, 0 replies; only message in thread
From: Takashi Yano @ 2022-03-14 10:39 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=85eb7125a65e7b62881c314b2ce59f8422dcc9ec

commit 85eb7125a65e7b62881c314b2ce59f8422dcc9ec
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date:   Sat Mar 12 06:19:53 2022 +0900

    Cygwin: fsync: Return EINVAL for special files.
    
    - Unlike linux, fsync() calls FlushFileBuffers() even for special
      files. This causes the problem reported in:
        https://cygwin.com/pipermail/cygwin/2022-March/251022.html
      This patch fixes the issue.

Diff:
---
 winsup/cygwin/fhandler.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 98d7a3b2d..fc7bf0a0e 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -1750,7 +1750,7 @@ fhandler_base::utimens (const struct timespec *tvp)
 int
 fhandler_base::fsync ()
 {
-  if (!get_handle () || nohandle ())
+  if (!get_handle () || nohandle () || pc.isspecial ())
     {
       set_errno (EINVAL);
       return -1;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-03-14 10:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-14 10:39 [newlib-cygwin/cygwin-3_3-branch] Cygwin: fsync: Return EINVAL for special files Takashi Yano

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).