From c7dbdc1f77949506ddce5448bf844e6bf4c948fc Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 8 Oct 2008 18:23:33 +0000 Subject: Fix harmless glib assertations with "cache=no" --- ChangeLog | 2 ++ cache.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index e3d32f6..352705e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,8 @@ * Fix error if username contains a comma character. Reported by Yang Zhang + * Fix harmless glib assertations with "cache=no" + 2008-07-11 Miklos Szeredi * Released 2.1 diff --git a/cache.c b/cache.c index c6be742..bb23f8f 100644 --- a/cache.c +++ b/cache.c @@ -105,6 +105,9 @@ static void cache_purge_parent(const char *path) void cache_invalidate(const char *path) { + if (!cache.on) + return; + pthread_mutex_lock(&cache.lock); cache_purge(path); pthread_mutex_unlock(&cache.lock); @@ -163,6 +166,9 @@ void cache_add_attr(const char *path, const struct stat *stbuf, uint64_t wrctr) struct node *node; time_t now; + if (!cache.on) + return; + pthread_mutex_lock(&cache.lock); if (wrctr == cache.write_ctr) { node = cache_get(path); -- cgit v1.2.3