1
0
mirror of https://github.com/Llewellynvdm/conky.git synced 2024-11-17 18:45:10 +00:00

make conky fs stuff report same as df for ext3 volumes

git-svn-id: https://conky.svn.sourceforge.net/svnroot/conky/trunk/conky@436 7f574dfc-610e-0410-a909-a81674777703
This commit is contained in:
David Carter 2005-12-01 06:32:14 +00:00
parent 04c825cb85
commit 1f16e29c84
5 changed files with 9 additions and 4 deletions

View File

@ -3,6 +3,8 @@
2003-11-30
* Fixed sf.net bugs 1369607, 1367735 and gentoo bug 113921,
all variations of the same array out of bounds issue.
* "Fixed" code in fs.c and conky.c to make fs stats match those displayed by df
(affects reporting against ext3 filesystems only)
2005-11-27
* new code in linux.c and top.c to calculate CPU % correctly on 2.6 kernels.

View File

@ -1,6 +1,6 @@
AC_INIT([Conky],[1.3.5dev],[brenden1@users.sourceforge.net])
AC_INIT([Conky],[1.3.5dev2],[brenden1@users.sourceforge.net])
AM_INIT_AUTOMAKE(conky, 1.3.5dev)
AM_INIT_AUTOMAKE(conky, 1.3.5dev2)
AM_CONFIG_HEADER(src/config.h)
AC_PROG_LIBTOOL

View File

@ -2501,7 +2501,7 @@ static void generate_text()
OBJ(fs_used) {
if (obj->data.fs != NULL)
human_readable(obj->data.fs->size -
obj->data.fs->avail,
(obj->data.fs->free ? obj->data.fs->free :obj->data.fs->avail),
p, 255);
}
OBJ(fs_bar_free) {

View File

@ -90,6 +90,7 @@ struct fs_stat {
char *path;
long long size;
long long avail;
long long free;
};
/*struct cpu_stat {

View File

@ -81,10 +81,12 @@ void update_fs_stat(struct fs_stat* fs)
if(statfs(fs->path, &s) == 0) {
fs->size = (long long) s.f_blocks * s.f_bsize;
/* bfree (root) or bavail (non-roots) ? */
fs->avail = (long long) s.f_bavail * s.f_bsize;
fs->avail = (long long) s.f_bavail* s.f_bsize;
fs->free = (long long) s.f_bfree * s.f_bsize;;
} else {
fs->size = 0;
fs->avail = 0;
fs->free = 0;
ERR("statfs '%s': %s", fs->path, strerror(errno));
}
}