changeset 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 dd8aff489cf2
children 0bdd2550530d
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: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