Cygwin: fsync: Fix EINVAL for block device.
The commitaf8a7c13b5
has a problem that fsync returns EINVAL for block device. This patch treats block devices as a special case. https://cygwin.com/pipermail/cygwin/2023-January/252916.html Fixes:af8a7c13b5
("Cygwin: fsync: Return EINVAL for special files.") Reported-by: Yano Ray <yanorei@hotmail.co.jp> Reviewed-by: Corinna Vinschen <corinna@vinschen.de> Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
This commit is contained in:
parent
5889a3cede
commit
17ad18afc6
|
@ -1728,7 +1728,8 @@ fhandler_base::utimens (const struct timespec *tvp)
|
|||
int
|
||||
fhandler_base::fsync ()
|
||||
{
|
||||
if (!get_handle () || nohandle () || pc.isspecial ())
|
||||
if (!get_handle () || nohandle ()
|
||||
|| (pc.isspecial () && !S_ISBLK (pc.dev.mode ())))
|
||||
{
|
||||
set_errno (EINVAL);
|
||||
return -1;
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
Bug Fixes
|
||||
---------
|
||||
|
||||
Fix a problem that fsync returns EINVAL for block device.
|
||||
Addresses: https://cygwin.com/pipermail/cygwin/2023-January/252916.html
|
Loading…
Reference in New Issue