diff --git a/winsup/cygwin/fhandler/base.cc b/winsup/cygwin/fhandler/base.cc index b2738cf20..9b49ec7b9 100644 --- a/winsup/cygwin/fhandler/base.cc +++ b/winsup/cygwin/fhandler/base.cc @@ -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; diff --git a/winsup/cygwin/release/3.4.6 b/winsup/cygwin/release/3.4.6 new file mode 100644 index 000000000..c1476ff46 --- /dev/null +++ b/winsup/cygwin/release/3.4.6 @@ -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