X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=support%2Fnfs%2Fcacheio.c;h=6a6ed5ac7f093a590e621895a03f2c9e3729683e;hp=f30373402d0888009abd53f07f14da690c45f6dd;hb=70561910500556c8109ca2e5683a92ed51c82bb7;hpb=3724317e223d46908aac2405bbd73ea2de4f36e5 diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c index f303734..6a6ed5a 100644 --- a/support/nfs/cacheio.c +++ b/support/nfs/cacheio.c @@ -154,15 +154,21 @@ int qword_eol(FILE *f) fprintf(f,"\n"); err = fflush(f); + if (err) { + xlog_warn("qword_eol: fflush failed: errno %d (%s)", + errno, strerror(errno)); + } /* * We must send one line (and one line only) in a single write * call. In case of a write error, libc may accumulate the * unwritten data and try to write it again later, resulting in a * multi-line write. So we must explicitly ask it to throw away - * any such cached data: + * any such cached data. But we return any original error + * indication to the caller. */ __fpurge(f); - return fflush(f); + fflush(f); + return err; }