]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Avoid logging uninteresting message for deletion of .dwo file
authorJoel Rosdahl <joel@rosdahl.net>
Wed, 3 Jul 2019 18:44:18 +0000 (20:44 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Wed, 3 Jul 2019 18:44:18 +0000 (20:44 +0200)
src/ccache.c

index 476eb542f06986a304fb3ee88289c82932e16172..71ad388f2f4412e3e1cfa04fdf71e0aec023e7d8 100644 (file)
@@ -1237,9 +1237,14 @@ to_cache(struct args *args, struct hash *depend_mode_hash)
        }
 
        if (seen_split_dwarf) {
-               // Remove any preexisting .dwo since we want to check if the compiler
-               // produced one.
-               x_unlink(output_dwo);
+               // Remove any pre-existing .dwo file since we want to check if the compiler
+               // produced one, intentionally not using x_unlink or tmp_unlink since we're
+               // not interested in logging successful deletions or failures due to
+               // non-existent .dwo files.
+               if (unlink(output_dwo) == -1 && errno != ENOENT) {
+                       cc_log("Failed to unlink %s: %s", output_dwo, strerror(errno));
+                       stats_update(STATS_BADOUTPUTFILE);
+               }
        }
 
        cc_log("Running real compiler");