]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Ignore return value from fwrite when writing debug log
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 16 Oct 2018 18:32:01 +0000 (20:32 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 16 Oct 2018 18:34:57 +0000 (20:34 +0200)
This silences some compilers’ warnings about ignoring return value of
fwrite.

There’s not much we can do if they fail, and it’s also not important
enough to e.g. call failed() for the debug logs.

src/hash.c
src/util.c

index 8a92085fae1a8356b19bd2115c2392243acbaa12..ae303322a2b893b13b1ada5eed69464a8a9b6a72 100644 (file)
@@ -32,7 +32,7 @@ do_hash_buffer(struct hash *hash, const void *s, size_t len)
 {
        mdfour_update(&hash->md, (const unsigned char *)s, len);
        if (len > 0 && hash->debug_binary) {
-               fwrite(s, 1, len, hash->debug_binary);
+               (void) fwrite(s, 1, len, hash->debug_binary);
        }
 }
 
@@ -40,7 +40,7 @@ static void
 do_debug_text(struct hash *hash, const void *s, size_t len)
 {
        if (len > 0 && hash->debug_text) {
-               fwrite(s, 1, len, hash->debug_text);
+               (void) fwrite(s, 1, len, hash->debug_text);
        }
 }
 
index a260025f6f3406d1d1a40bc73fb6dff01e9fd05b..36d3b632319fdf7553647fed1f5f18fb744ca46b 100644 (file)
@@ -219,7 +219,7 @@ void
 cc_dump_log_buffer(const char *path)
 {
        FILE *file = fopen(path, "w");
-       fwrite(logbuffer, 1, logsize, file);
+       (void) fwrite(logbuffer, 1, logsize, file);
        fclose(file);
 }