From 54fae3a9ca0af5ab29cc02d9c91fc2c63c6bc872 Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 19 Sep 2017 21:04:30 +0300 Subject: Merge with latest original package version (master branch) --- libpkgconf/cache.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libpkgconf/cache.c') diff --git a/libpkgconf/cache.c b/libpkgconf/cache.c index 986eba5..1662ce5 100644 --- a/libpkgconf/cache.c +++ b/libpkgconf/cache.c @@ -13,6 +13,7 @@ * from the use of this software. */ +#include #include /* @@ -84,6 +85,9 @@ pkgconf_cache_add(pkgconf_client_t *client, pkgconf_pkg_t *pkg) pkgconf_node_insert(&pkg->cache_iter, pkg, &client->pkg_cache); PKGCONF_TRACE(client, "added @%p to cache", pkg); + + /* mark package as cached */ + pkg->flags |= PKGCONF_PKG_PROPF_CACHED; } /* @@ -103,6 +107,9 @@ pkgconf_cache_remove(pkgconf_client_t *client, pkgconf_pkg_t *pkg) if (pkg == NULL) return; + if (!(pkg->flags & PKGCONF_PKG_PROPF_CACHED)) + return; + PKGCONF_TRACE(client, "removed @%p from cache", pkg); pkgconf_node_delete(&pkg->cache_iter, &client->pkg_cache); -- cgit v1.1