summaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
authorKevin Coffman <kwc@citi.umich.edu>2009-04-03 15:20:09 -0400
committerSteve Dickson <steved@redhat.com>2009-04-03 15:20:09 -0400
commit70561910500556c8109ca2e5683a92ed51c82bb7 (patch)
tree090896a776bafd2ed1860618eb07f4785f88bfdc /support
parent7de6c8c54ac195d659c8ac2d2ac01ef47c6c3ecd (diff)
downloadnfs-utils-70561910500556c8109ca2e5683a92ed51c82bb7.tar.gz
nfs-utils-70561910500556c8109ca2e5683a92ed51c82bb7.tar.xz
nfs-utils-70561910500556c8109ca2e5683a92ed51c82bb7.zip
cacheio: return any original error from qword_eol
If the initial fflush() fails in qword_eol, log the failure and return the indication of the original failure, not the successful cover-up. Signed-off-by: Kevin Coffman <kwc@citi.umich.edu> Signed-off-by: Steve Dickson <steved@redhat.com>
Diffstat (limited to 'support')
-rw-r--r--support/nfs/cacheio.c10
1 files changed, 8 insertions, 2 deletions
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;
}