From: Thomas Roessler Date: Mon, 3 Dec 2001 13:31:02 +0000 (+0000) Subject: Try to detect write() errors by calling fsync() after fflush(). May X-Git-Tag: mutt-1-3-25-rel~26 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=339a5af0cb77513c5b82da99e11415d52b8f9f7a;p=mutt Try to detect write() errors by calling fsync() after fflush(). May fix #895. --- diff --git a/mx.c b/mx.c index 5d394fe1..213fa6f5 100644 --- 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;