From: Andreas Schwab Date: Sat, 6 Oct 2007 08:15:26 +0000 (+0000) Subject: (Fwrite_region): Ignore EINVAL error from fsync. X-Git-Tag: emacs-pretest-23.0.90~10513 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6cff77fd8a2d80eae2ae9bb8be115455cd0de418;p=emacs.git (Fwrite_region): Ignore EINVAL error from fsync. --- diff --git a/src/ChangeLog b/src/ChangeLog index b9ff2fafbe2..cfdf17f0842 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2007-10-06 Andreas Schwab + + * fileio.c (Fwrite_region): Ignore EINVAL error from fsync. + 2007-10-04 Juanma Barranquero * image.c (syms_of_image) : Fix typo in docstring. diff --git a/src/fileio.c b/src/fileio.c index b76d243346e..29d12a0b0c3 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5359,8 +5359,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