]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Fixed the check for empty object file vs diagnostics
authorAlexey Tourbin <alexey.tourbin@gmail.com>
Sat, 18 Feb 2017 13:29:53 +0000 (16:29 +0300)
committerJoel Rosdahl <joel@rosdahl.net>
Sat, 25 Mar 2017 19:16:42 +0000 (20:16 +0100)
The test for diagnostic file currently interferes with the check for
empty object file.  Since the check for diagnostic file is much more
similar to the check for dependency file, I put it there.

ccache.c

index 4081b0b2fd94f537cfa1f5a833d5f2cf88634efa..f039a367abf6f7d54ce299ebb4e4d10274ab9788 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -1869,12 +1869,6 @@ from_cache(enum fromcache_call_mode mode, bool put_object_in_manifest)
                return;
        }
 
-       // Check if the diagnostic file is there.
-       if (output_dia && stat(cached_dia, &st) != 0) {
-               cc_log("Diagnostic file %s not in cache", cached_dia);
-               return;
-       }
-
        // Occasionally, e.g. on hard reset, our cache ends up as just filesystem
        // meta-data with no content. Catch an easy case of this.
        if (st.st_size == 0) {
@@ -1910,6 +1904,12 @@ from_cache(enum fromcache_call_mode mode, bool put_object_in_manifest)
                return;
        }
 
+       // Check if the diagnostic file is there.
+       if (output_dia && stat(cached_dia, &st) != 0) {
+               cc_log("Diagnostic file %s not in cache", cached_dia);
+               return;
+       }
+
        // Copy object file from cache. Do so also for FissionDwarf file, cached_dwo,
        // when -gsplit-dwarf is specified.
        if (!str_eq(output_obj, "/dev/null")) {