changeset 85057:5b8f5c8e3e4b

(Fwrite_region): Ignore EINVAL error from fsync.
author Andreas Schwab <schwab@suse.de>
date Sat, 06 Oct 2007 08:15:09 +0000
parents f7a1ed49fd9f
children c18eabb4b7b1
files src/fileio.c
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/fileio.c	Sat Oct 06 01:52:18 2007 +0000
+++ b/src/fileio.c	Sat Oct 06 08:15:09 2007 +0000
@@ -5359,8 +5359,10 @@
      it, and that means the fsync here is not crucial for autosave files.  */
   if (!auto_saving && !write_region_inhibit_fsync && fsync (desc) < 0)
     {
-      /* If fsync fails with EINTR, don't treat that as serious.  */
-      if (errno != EINTR)
+      /* If fsync fails with EINTR, don't treat that as serious.  Also
+	 ignore EINVAL which happens when fsync is not supported on this
+	 file.  */
+      if (errno != EINTR && errno != EINVAL)
 	failure = 1, save_errno = errno;
     }
 #endif