From 19a1f0aa8c25c00fc3d819e378c9c0a87e6a31a8 Mon Sep 17 00:00:00 2001 From: John Johansen Date: Mon, 14 Oct 2013 01:51:21 -0700 Subject: [PATCH] Rev 2203 (rev 2097 on the 2.8 branch) created a regression such that cache files will be written out even if the '--skip-bad-cache' option is given and the cached features file differs from the features of the currently running kernel. The patch below fixes the regression. From: John Johansen Acked-by: Steve Beattie --- parser/parser_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/parser/parser_main.c b/parser/parser_main.c index 442bd951a..b77ee2a5b 100644 --- a/parser/parser_main.c +++ b/parser/parser_main.c @@ -1272,7 +1272,7 @@ static int create_cache(const char *cachedir, const char *path, struct stat stat_file; FILE * f = NULL; - if (cond_clear_cache && clear_cache_files(cacheloc) != 0) + if (clear_cache_files(cacheloc) != 0) goto error; create_file: @@ -1347,7 +1347,7 @@ static void setup_flags(void) get_flags_string(&cache_flags, cache_features_path); if (cache_flags) { if (strcmp(flags_string, cache_flags) != 0) { - if (write_cache) { + if (write_cache && cond_clear_cache) { if (create_cache(cacheloc, cache_features_path, flags_string)) skip_read_cache = 1;