]> code.delx.au - gnu-emacs/commitdiff
(Fwrite_region): Ignore EINVAL error from fsync.
authorAndreas Schwab <schwab@suse.de>
Sat, 6 Oct 2007 08:18:03 +0000 (08:18 +0000)
committerAndreas Schwab <schwab@suse.de>
Sat, 6 Oct 2007 08:18:03 +0000 (08:18 +0000)
src/ChangeLog
src/fileio.c

index 656128832b61d5c92aa7fff01e590109e9c73711..08716763cecd53dd6902a0751c43ad3be18b8aee 100644 (file)
@@ -1,3 +1,7 @@
+2007-10-06  Andreas Schwab  <schwab@suse.de>
+
+       * fileio.c (Fwrite_region): Ignore EINVAL error from fsync.
+
 2007-10-05  YAMAMOTO Mitsuharu  <mituharu@math.s.chiba-u.ac.jp>
 
        * macterm.c (mac_load_query_font): Fix missing return value.
index 26723fa4f3eba4f292ddb8c4b0079bf363ebe880..ac5a4f5679439d763747c9ca32f890a4ac698f59 100644 (file)
@@ -5274,8 +5274,10 @@ This does code conversion according to the value of
      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