X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=support%2Fnfs%2Fcacheio.c;h=9d271cd4733d77328a6f2b3e5ec8a80b5da8a73b;hb=12e990f4b07172c693203ffd1e12d0518cacb9e6;hp=a4bfedbbc02eb1e3522dea1172be1973ff54b3de;hpb=2e0b281cbebd6624c2673f5e6822f85df698f273;p=nfs-utils.git diff --git a/support/nfs/cacheio.c b/support/nfs/cacheio.c index a4bfedb..9d271cd 100644 --- a/support/nfs/cacheio.c +++ b/support/nfs/cacheio.c @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -111,7 +112,18 @@ void qword_printint(FILE *f, int num) int qword_eol(FILE *f) { + int err; + fprintf(f,"\n"); + err = fflush(f); + /* + * 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: + */ + __fpurge(f); return fflush(f); } @@ -249,13 +261,14 @@ cache_flush(int force) char path[200]; time_t now; /* Note: the order of these caches is important. - * The need to be flushed in dependancy order. So + * They need to be flushed in dependancy order. So * a cache that references items in another cache, * as nfsd.fh entries reference items in nfsd.export, * must be flushed before the cache that it references. */ static char *cachelist[] = { "auth.unix.ip", + "auth.unix.gid", "nfsd.fh", "nfsd.export", NULL