Browse Source

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.
topic/gso_gro
Takashi Yano 4 years ago
parent
commit
af8a7c13b5
  1. 2
      winsup/cygwin/fhandler.cc

2
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;

Loading…
Cancel
Save