On Sunday, October 07, 2018 13:45 you wrote:
> Hi Peter,
>
> On 30/07/2018 15:01, Peter Hyman wrote:
> > gkrellm krell scale for volume sizes is at 100% in some cases. See graphic.
> > This issue appeared after creating some LVM volumes.
> >
> > This patch addresses two issues:
> > 1. changes long long type to unsigned long long since disk block size is always positive.
>
> This would also need type changes for other variables otherwise you're
> comparing values of different signedness which triggers compiler
> warnings, hence I've left that out for now.
The structure members,
gint64 blocks,
bfree,
bavail,
bsize;
part of the FSMon structure in fs.c and the Mount structure in client.c would need adjustment to guint64.
However, there is some inconsistency in client.c
client_fs_line_from_server(gchar *line)
{
GList *list;
Mount *m;
gchar dir[128], dev[64];
gulong blocks, bavail, bfree, bsize;
where gulong is used and not gint64 and later there are assignments from gint64
if (!strcmp(m->directory, dir) && !strcmp(m->device, dev))
{
m->blocks = blocks;
m->bavail = bavail;
m->bfree = bfree;
m->bsize = bsize;
break;
}
So, you're correct, a little bit of work will be necessary to totally clean up the code. In any case, unsigned long or long long is good form for disk sizes.
Luckily, the main issue of not having the right krell values computed is resolved. The rest can be tolerated by compilers!
|