Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/winsup
diff options
context:
space:
mode:
authorTakashi Yano <takashi.yano@nifty.ne.jp>2023-01-21 15:33:03 +0300
committerTakashi Yano <takashi.yano@nifty.ne.jp>2023-01-22 13:00:45 +0300
commit17ad18afc62ceefe01273e4c2fff9114275ab909 (patch)
treea3440b9fc9af0a1f1f3d4ef74f3e446991f732b9 /winsup
parent5889a3cede99352330637f1bef7641d9752eb6ed (diff)
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>
Diffstat (limited to 'winsup')
-rw-r--r--winsup/cygwin/fhandler/base.cc3
-rw-r--r--winsup/cygwin/release/3.4.65
2 files changed, 7 insertions, 1 deletions
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