summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Tourbin <alexey.tourbin@gmail.com>2017-02-18 16:29:53 +0300
committerJoel Rosdahl <joel@rosdahl.net>2017-03-25 20:16:42 +0100
commit0ffb141fdc904f3005156cc8e71dd48eeab7c970 (patch)
tree76e7e60b9fc92611069f64b1085e7afff278163f
parentaa16483c4792a030646b36ce3edd5c5dd935c919 (diff)
downloadccache-0ffb141fdc904f3005156cc8e71dd48eeab7c970.tar.gz
Fixed the check for empty object file vs diagnostics
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.
-rw-r--r--ccache.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/ccache.c b/ccache.c
index 4081b0b2..f039a367 100644
--- 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")) {