]> git.ipfire.org Git - thirdparty/ccache.git/commit
stats: Fix statistics update with full filesystem
authorRussell King <rmk@armlinux.org.uk>
Thu, 31 Oct 2019 16:30:22 +0000 (16:30 +0000)
committerJoel Rosdahl <joel@rosdahl.net>
Fri, 1 Nov 2019 20:06:42 +0000 (21:06 +0100)
commit1a432329b5b9dfe214e931e09cd38547936cc294
treed29aabb2f49bd621934ceaad06b06b1668d9a1c2
parent5d9a289f594c22361c18baf41a8a9aa5bd6a1026
stats: Fix statistics update with full filesystem

The statistics file update does not check for write errors correctly
as stdio files are normally buffered.  This means that data can be
written to the stdio buffer but not written out until fclose().
Hence, it is imperative that the fclose() return value is also
checked.

If either fprintf() or fclose() fail, clean up the temporary file,
rather than littering the filesystem with needless temporary files.

Signed-off-by: Russell King <rmk@armlinux.org.uk>
src/stats.c