mirror of
git://sourceware.org/git/newlib-cygwin.git
synced 2025-02-28 12:05:47 +08:00
Cygwin: fsync: Fix EINVAL for block device.
The commit af8a7c13b516 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: af8a7c13b516 ("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
3123fdeecb
commit
bdb9f5b173
@ -1728,7 +1728,8 @@ fhandler_base::utimens (const struct timespec *tvp)
|
|||||||
int
|
int
|
||||||
fhandler_base::fsync ()
|
fhandler_base::fsync ()
|
||||||
{
|
{
|
||||||
if (!get_handle () || nohandle () || pc.isspecial ())
|
if (!get_handle () || nohandle ()
|
||||||
|
|| (pc.isspecial () && !S_ISBLK (pc.dev.mode ())))
|
||||||
{
|
{
|
||||||
set_errno (EINVAL);
|
set_errno (EINVAL);
|
||||||
return -1;
|
return -1;
|
||||||
|
5
winsup/cygwin/release/3.4.6
Normal file
5
winsup/cygwin/release/3.4.6
Normal file
@ -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…
x
Reference in New Issue
Block a user