aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2012-02-08 10:21:33 +0100
committerMiklos Szeredi <mszeredi@suse.cz>2012-02-08 10:21:33 +0100
commitc5949f06fa9052b6ae846f7f61abf71829cac481 (patch)
treed39b59a727e7f1fa64466f03b3b24fd76eab189c
parentb0f3d73028d50d885ee30ed7b2770cee0bc69267 (diff)
downloadsshfs-c5949f06fa9052b6ae846f7f61abf71829cac481.tar
sshfs-c5949f06fa9052b6ae846f7f61abf71829cac481.tar.gz
sshfs-c5949f06fa9052b6ae846f7f61abf71829cac481.tar.bz2
sshfs-c5949f06fa9052b6ae846f7f61abf71829cac481.zip
fix unused but set variables
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]
-rw-r--r--cache.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/cache.c b/cache.c
index bb23f8f..2a06726 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;