patch 8.0.1335: writefile() using fsync() may give an error.
Problem: Writefile() using fsync() may give an error for a device.
(Yasuhiro Matsumoto)
Solution: Ignore fsync() failing. (closes #2373)
diff --git a/src/evalfunc.c b/src/evalfunc.c
index 8d288e0..76c5768 100644
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -13449,8 +13449,10 @@
if (write_list(fd, list, binary) == FAIL)
ret = -1;
#ifdef HAVE_FSYNC
- else if (do_fsync && fsync(fileno(fd)) != 0)
- EMSG(_(e_fsync));
+ else if (do_fsync)
+ /* Ignore the error, the user wouldn't know what to do about it.
+ * May happen for a device. */
+ ignored = fsync(fileno(fd));
#endif
fclose(fd);
}