X-Git-Url: https://git.decadent.org.uk/gitweb/?p=nfs-utils.git;a=blobdiff_plain;f=support%2Fnfs%2Fcacheio.c;fp=support%2Fnfs%2Fcacheio.c;h=61e07a8257c961a7815ac0ae3816352cf14cfba5;hp=9bad8e61f827e814592f539d51fc2784547b939a;hb=fb06ed9fc1fa11a95544fb2d89adb6c51ef5d946;hpb=5b30c751e3bceab727de684c5ca96c6edd6df001 diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c index 9bad8e6..61e07a8 100644 --- a/support/nfs/cacheio.c +++ b/support/nfs/cacheio.c @@ -153,15 +153,25 @@ void qword_printuint(FILE *f, unsigned int num) fprintf(f, "%u ", num); } +void qword_printtimefrom(FILE *f, unsigned int num) +{ + fprintf(f, "%lu ", time(0) + num); +} + 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