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.
This commit is contained in:
Takashi Yano 2022-03-12 06:19:53 +09:00
parent b2d4dc167c
commit af8a7c13b5
1 changed files with 1 additions and 1 deletions

View File

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