From 4e38f139f92b8b3729f82c37f0904c2b77d3eb58 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sat, 21 Oct 2017 13:10:36 -0400 Subject: Report errors that occur when closing files Otherwise we miss write errors that occur when flushing the cache. --- color.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'color.c') diff --git a/color.c b/color.c index 8df6a1f..1025c9e 100644 --- a/color.c +++ b/color.c @@ -288,6 +288,8 @@ int cfclose(CFILE *cfile) { if (cfile) { if (cfile->close) { ret = fclose(cfile->file); + } else if (cfile->file) { + ret = fflush(cfile->file); } free(cfile); } -- cgit v1.2.3