Skip to content

Commit 1a52814

Browse files
authored
Merge branch 'master' into fill-stat-info-from-cache
2 parents 5f767de + c9bf8ad commit 1a52814

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Diff for: cache.c

+6-3
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,9 @@ struct cache_dirent {
7272
static void free_node(gpointer node_)
7373
{
7474
struct node *node = (struct node *) node_;
75-
if (node->dir != NULL)
75+
if (node->dir != NULL) {
7676
g_ptr_array_free(node->dir, TRUE);
77+
}
7778
g_free(node);
7879
}
7980

@@ -207,8 +208,9 @@ static void cache_add_dir(const char *path, GPtrArray *dir)
207208

208209
pthread_mutex_lock(&cache.lock);
209210
node = cache_get(path);
210-
if (node->dir != NULL)
211+
if (node->dir != NULL) {
211212
g_ptr_array_free(node->dir, TRUE);
213+
}
212214
node->dir = dir;
213215
node->dir_valid = time(NULL) + cache.dir_timeout_secs;
214216
if (node->dir_valid > node->valid)
@@ -391,8 +393,9 @@ static int cache_readdir(const char *path, void *buf, fuse_fill_dir_t filler,
391393
if (node != NULL && node->dir != NULL) {
392394
time_t now = time(NULL);
393395
if (node->dir_valid - now >= 0) {
394-
for(cdent = (struct cache_dirent**)node->dir->pdata; *cdent != NULL; cdent++)
396+
for(cdent = (struct cache_dirent**)node->dir->pdata; *cdent != NULL; cdent++) {
395397
filler(buf, (*cdent)->name, &(*cdent)->stat, 0, 0);
398+
}
396399
pthread_mutex_unlock(&cache.lock);
397400
return 0;
398401
}

0 commit comments

Comments
 (0)