X-Git-Url: https://gitweb.ps.run/ps-cgit/blobdiff_plain/de297883385030f4bdcd2f5c3839d1187611b949..3b485cc5422f800d142c7023295e82c0a1c10b19:/cache.c diff --git a/cache.c b/cache.c index 6736a01..2ccdc4e 100644 --- a/cache.c +++ b/cache.c @@ -224,6 +224,12 @@ static int fill_slot(struct cache_slot *slot) /* Generate cache content */ slot->fn(); + /* Make sure any buffered data is flushed to the file */ + if (fflush(stdout)) { + close(tmp); + return errno; + } + /* update stat info */ if (fstat(slot->lock_fd, &slot->cache_st)) { close(tmp);