committing patch from Sebastien Bacher <seb128@debian.org> for Linux 2.6

2003-10-20  Bastien Nocera  <hadess@hadess.net>

	* glibtop_server.h:
	* mem.c: (glibtop_get_mem_s):
	* swap.c: (glibtop_get_swap_s): committing patch from Sebastien
	Bacher <seb128@debian.org> for Linux 2.6 support (Closes: #104747)
This commit is contained in:
Bastien Nocera
2003-10-20 20:41:06 +00:00
committed by Bastien Nocera
parent 1c96e35cc0
commit 486e6b0260
4 changed files with 39 additions and 19 deletions

View File

@@ -70,13 +70,11 @@ glibtop_get_swap_s (glibtop *server, glibtop_swap *buf)
buffer [len] = '\0';
p = skip_line (buffer);
p = skip_line (p);
p = skip_token (p); /* "Swap:" */
buf->total = strtoul (p, &p, 0);
buf->used = strtoul (p, &p, 0);
buf->free = strtoul (p, &p, 0);
/* Kernel 2.6 with multiple lines */
buf->total = get_scaled(buffer, "SwapTotal:");
buf->free = get_scaled(buffer, "SwapFree:");
buf->used = buf->total - buf->free;
buf->flags = _glibtop_sysdeps_swap;