mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
parser: Lift force_clear_cache handling from setup_cache()
This keeps us from having to use the force_clear_cache global in policy_cache.c. Signed-off-by: Tyler Hicks <tyhicks@canonical.com> Acked-by: John Johansen <john.johansen@canonical.com>
This commit is contained in:
parent
d2e3f806c0
commit
22993081c8
2 changed files with 10 additions and 3 deletions
|
@ -914,6 +914,16 @@ int main(int argc, char *argv[])
|
|||
return 1;
|
||||
}
|
||||
|
||||
if (force_clear_cache) {
|
||||
if (clear_cache_files(cacheloc)) {
|
||||
PERROR(_("Failed to clear cache files (%s): %s\n"),
|
||||
cacheloc, strerror(errno));
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
retval = setup_cache(cacheloc);
|
||||
if (retval) {
|
||||
PERROR(_("Failed setting up policy cache (%s): %s\n"),
|
||||
|
|
|
@ -238,9 +238,6 @@ int setup_cache(const char *cacheloc)
|
|||
return -1;
|
||||
}
|
||||
|
||||
if (force_clear_cache)
|
||||
exit(clear_cache_files(cacheloc));
|
||||
|
||||
/*
|
||||
* Deal with cache directory versioning:
|
||||
* - If cache/.features is missing, create it if --write-cache.
|
||||
|
|
Loading…
Add table
Reference in a new issue