From 8b46082e321915012397b72146394ea7c7c7f711 Mon Sep 17 00:00:00 2001 From: wbaumann Date: Sat, 14 Nov 2009 08:43:24 +0000 Subject: [PATCH] initialize fs_stat->files --- ChangeLog | 6 +++++- TODO | 2 ++ src/cache.c | 27 ++++++++++++++------------- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3fb871f..e57aba7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,13 @@ ChangeLog for davfs2 -------------------- +2009-11-14 Werner Baumann (werner.baumann@onlinehome.de) + * cache.c, dav_init_cache: + Initialize fs_stat->files. + 2009-11-03 Werner Baumann (werner.baumann@onlinehome.de) * webdav.c, ssl_verify: - Don't accept suspidious certificates if !have_terminal. + Don't accept suspicious certificates if !have_terminal. 2009-10-18 Werner Baumann (werner.baumann@onlinehome.de) * mount_davfs.c, webdav.c: diff --git a/TODO b/TODO index 92be239..a0a3062 100644 --- a/TODO +++ b/TODO @@ -30,3 +30,5 @@ davfs2 TODO 2009-10-23 by broken server implementations (see Debian bug #551782 - davfs2: improve the output in case of a server with a broken LOCK) +- integrate with gnome-keyring? + diff --git a/src/cache.c b/src/cache.c index a85b615..850e2af 100644 --- a/src/cache.c +++ b/src/cache.c @@ -613,6 +613,20 @@ dav_init_cache(const dav_args *args, const char *mpoint) fs_stat = (dav_stat *) malloc(sizeof(dav_stat)); if (!fs_stat) abort(); + fs_stat->blocks = 0x65B9AA; + fs_stat->bfree = 0x32DCD5; + fs_stat->bavail = 0x32DCD5; + fs_stat->files = 0; + fs_stat->ffree = 666666; + struct stat cache_st; + if (stat(cache_dir, &cache_st) == 0) { + fs_stat->bsize = cache_st.st_blksize; + } else { + fs_stat->bsize = 4096; + } + fs_stat->namelen = 256; + fs_stat->utime = 0; + if (debug) syslog(LOG_MAKEPRI(LOG_DAEMON, LOG_DEBUG), "Checking cache directory"); max_cache_size = args->cache_size * 0x100000; @@ -635,19 +649,6 @@ dav_init_cache(const dav_args *args, const char *mpoint) clean_cache(); - fs_stat->blocks = 0x65B9AA; - fs_stat->bfree = 0x32DCD5; - fs_stat->bavail = 0x32DCD5; - fs_stat->ffree = 666666; - struct stat cache_st; - if (stat(cache_dir, &cache_st) == 0) { - fs_stat->bsize = cache_st.st_blksize; - } else { - fs_stat->bsize = 4096; - } - fs_stat->namelen = 256; - fs_stat->utime = 0; - int ret = update_directory(root, 0); if (ret == EAGAIN) { root->utime = 0;