]> granicus.if.org Git - neomutt/commitdiff
Try to detect write() errors by calling fsync() after fflush(). May
authorThomas Roessler <roessler@does-not-exist.org>
Mon, 3 Dec 2001 13:31:02 +0000 (13:31 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Mon, 3 Dec 2001 13:31:02 +0000 (13:31 +0000)
fix #895.

mx.c

diff --git a/mx.c b/mx.c
index 5d394fe18d40938cfc2139c044ae8af5a8ede890..213fa6f5d180c59871b2438d3c8079f3c510efe0 100644 (file)
--- a/mx.c
+++ b/mx.c
@@ -1485,7 +1485,7 @@ int mx_commit_message (MESSAGE *msg, CONTEXT *ctx)
   }
   
   if (r == 0 && (ctx->magic == M_MBOX || ctx->magic == M_MMDF || ctx->magic == M_KENDRA)
-      && fflush (msg->fp) == EOF)
+      && (fflush (msg->fp) == EOF || fsync (fileno (msg->fp)) == -1))
   {
     mutt_perror _("Can't write message");
     r = -1;