]> git.decadent.org.uk Git - nfs-utils.git/blobdiff - support/nfs/cacheio.c
mountd: fix checking for errors when exporting filesystems
[nfs-utils.git] / support / nfs / cacheio.c
index e641c4535c652c803dc067e4cfe3f4633bc28b12..61e07a8257c961a7815ac0ae3816352cf14cfba5 100644 (file)
@@ -162,11 +162,16 @@ int qword_eol(FILE *f)
 {
        int err;
 
-       fprintf(f,"\n");
-       err = fflush(f);
-       if (err) {
-               xlog_warn("qword_eol: fflush failed: errno %d (%s)",
+       err = fprintf(f,"\n");
+       if (err < 0) {
+               xlog_warn("qword_eol: fprintf failed: errno %d (%s)",
                            errno, strerror(errno));
+       } else {
+               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