diff src/fileio.c @ 78980:ac06b6d5fee4

(Fwrite_region): Ignore EINVAL error from fsync.
author Andreas Schwab <schwab@suse.de>
date Sat, 06 Oct 2007 08:17:48 +0000
parents 1677cf1c2509
children 29f6806df351
line wrap: on
line diff
--- a/src/fileio.c	Sat Oct 06 01:45:16 2007 +0000
+++ b/src/fileio.c	Sat Oct 06 08:17:48 2007 +0000
@@ -5274,8 +5274,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