aboutsummaryrefslogtreecommitdiffstats
path: root/cache.c
diff options
context:
space:
mode:
Diffstat (limited to 'cache.c')
-rw-r--r--cache.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/cache.c b/cache.c
index e70af13..13cceac 100644
--- a/cache.c
+++ b/cache.c
@@ -272,6 +272,13 @@ static int process_slot(struct cache_slot *slot)
{
int err;
+ /*
+ * Make sure any buffered data is flushed before we redirect,
+ * do sendfile(2) or write(2)
+ */
+ if (fflush(stdout))
+ return errno;
+
err = open_slot(slot);
if (!err && slot->match) {
if (is_expired(slot)) {