From c85bca38f5b2936ec16810ea3c04cdaf13d98974 Mon Sep 17 00:00:00 2001 From: John Johansen Date: Wed, 25 Mar 2015 17:09:25 -0500 Subject: [PATCH] fix cache write to not happen when skip-bad-cache is specified Signed-off-by: John Johansen Acked-by: Tyler Hicks --- parser/parser_main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/parser/parser_main.c b/parser/parser_main.c index 750bb0992..ba98a10ea 100644 --- a/parser/parser_main.c +++ b/parser/parser_main.c @@ -966,8 +966,14 @@ int process_profile(int option, const char *profilename) stat_bin.st_size > 0) { if (valid_cached_file_version(cachename)) set_mru_tstamp(stat_bin.st_ctim); - } else if (debug_cache) - pwarn("%s: Invalid or missing cache file '%s'\n", progname, cachename); + else if (!cond_clear_cache) + write_cache = 0; + } else { + if (!cond_clear_cache) + write_cache = 0; + if (debug_cache) + pwarn("%s: Invalid or missing cache file '%s' (%s)\n", progname, cachename, strerror(errno)); + } } }