From b4023a19dd7ec7a099d2e0df491547cf3bb6bec3 Mon Sep 17 00:00:00 2001 From: Benjamin Fleischer Date: Fri, 20 Jan 2012 09:22:54 +0100 Subject: Apply modified sshfs 2.2 patch from MacFUSE Based on Amit Singh's work at http://code.google.com/p/macfuse/ --- cache.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'cache.c') diff --git a/cache.c b/cache.c index bb23f8f..7e146e7 100644 --- a/cache.c +++ b/cache.c @@ -559,6 +559,9 @@ struct fuse_operations *cache_init(struct fuse_cache_operations *oper) cache.next_oper = oper; cache_unity_fill(oper, &cache_oper); +#if __APPLE__ + cache_enabled = cache.on; +#endif if (cache.on) { cache_fill(oper, &cache_oper); pthread_mutex_init(&cache.lock, NULL); @@ -593,3 +596,7 @@ int cache_parse_options(struct fuse_args *args) return fuse_opt_parse(args, &cache, cache_opts, NULL); } + +#if __APPLE__ +int cache_enabled; +#endif -- cgit v1.2.3 From c1284b4089ced2df04752e144817a4d5182434a9 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Wed, 8 Feb 2012 10:21:33 +0100 Subject: fix unused but set variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit cache.c: In function ‘cache_add_attr’: cache.c:167:9: warning: variable ‘now’ set but not used [-Wunused-but-set-variable] cache.c: In function ‘cache_add_dir’: cache.c:188:9: warning: variable ‘now’ set but not used [-Wunused-but-set-variable] cache.c: In function ‘cache_add_link’: cache.c:212:9: warning: variable ‘now’ set but not used [-Wunused-but-set-variable] --- cache.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'cache.c') diff --git a/cache.c b/cache.c index 7e146e7..a2e5939 100644 --- a/cache.c +++ b/cache.c @@ -164,7 +164,6 @@ static struct node *cache_get(const char *path) void cache_add_attr(const char *path, const struct stat *stbuf, uint64_t wrctr) { struct node *node; - time_t now; if (!cache.on) return; @@ -172,7 +171,6 @@ void cache_add_attr(const char *path, const struct stat *stbuf, uint64_t wrctr) pthread_mutex_lock(&cache.lock); if (wrctr == cache.write_ctr) { node = cache_get(path); - now = time(NULL); node->stat = *stbuf; node->stat_valid = time(NULL) + cache.stat_timeout; if (node->stat_valid > node->valid) @@ -185,11 +183,9 @@ void cache_add_attr(const char *path, const struct stat *stbuf, uint64_t wrctr) static void cache_add_dir(const char *path, char **dir) { struct node *node; - time_t now; pthread_mutex_lock(&cache.lock); node = cache_get(path); - now = time(NULL); g_strfreev(node->dir); node->dir = dir; node->dir_valid = time(NULL) + cache.dir_timeout; @@ -209,11 +205,9 @@ static size_t my_strnlen(const char *s, size_t maxsize) static void cache_add_link(const char *path, const char *link, size_t size) { struct node *node; - time_t now; pthread_mutex_lock(&cache.lock); node = cache_get(path); - now = time(NULL); g_free(node->link); node->link = g_strndup(link, my_strnlen(link, size-1)); node->link_valid = time(NULL) + cache.link_timeout; -- cgit v1.2.3