Back to previous version.

* fsusage.c: (_glibtop_get_fsusage_read_write),
	(glibtop_get_fsusage_s):
	* mountlist.c: (glibtop_get_mountlist_s): Back to previous version.

	* fsusage.c: (linux_2_6_0), (linux_2_4_0),
	(_glibtop_linux_get_fsusage_read_write): Back to previous version.
	Now set .flags correctly.
This commit is contained in:
Benoît Dejean
2004-09-20 23:43:24 +00:00
parent a6311d88c3
commit 0b0b1ab43c
5 changed files with 36 additions and 28 deletions

View File

@@ -1,3 +1,9 @@
2004-09-21 Benoît Dejean <tazforever@dlfp.org>
* fsusage.c: (linux_2_6_0), (linux_2_4_0),
(_glibtop_linux_get_fsusage_read_write): Back to previous version.
Now set .flags correctly.
2004-09-19 Benoît Dejean <tazforever@dlfp.org>
* fsusage.c: (linux_2_6_0), (linux_2_4_0),

View File

@@ -11,7 +11,7 @@
#include <string.h>
#include <stdlib.h>
gboolean _glibtop_linux_get_fsusage_read_write(glibtop *server,
void _glibtop_linux_get_fsusage_read_write(glibtop *server,
glibtop_fsusage *buf,
const char *path);
@@ -20,12 +20,11 @@ gboolean _glibtop_linux_get_fsusage_read_write(glibtop *server,
* linux/Documentation/iostats.txt
*/
static gboolean linux_2_6_0(glibtop *server, glibtop_fsusage *buf, const char *path)
static void linux_2_6_0(glibtop *server, glibtop_fsusage *buf, const char *path)
{
FILE *mtab = setmntent("/etc/mtab", "r");
struct mntent *emnt;
gboolean ret = FALSE;
while((emnt = getmntent(mtab)) != NULL)
{
@@ -76,35 +75,31 @@ static gboolean linux_2_6_0(glibtop *server, glibtop_fsusage *buf, const char *p
p = skip_token(p);
buf->write = strtoull(p, &p, 0);
ret = TRUE;
buf->flags |= (1 << GLIBTOP_FSUSAGE_READ) | (1 << GLIBTOP_FSUSAGE_WRITE);
break;
}
}
endmntent(mtab);
return ret;
}
static gboolean linux_2_4_0(glibtop *server, glibtop_fsusage *buf, const char *path)
static void linux_2_4_0(glibtop *server, glibtop_fsusage *buf, const char *path)
{
return FALSE;
}
gboolean _glibtop_linux_get_fsusage_read_write(glibtop *server,
glibtop_fsusage *buf,
const char *path)
void _glibtop_linux_get_fsusage_read_write(glibtop *server,
glibtop_fsusage *buf,
const char *path)
{
if(server->os_version_code >= LINUX_VERSION_CODE(2, 6, 0))
{
return linux_2_6_0(server, buf, path);
linux_2_6_0(server, buf, path);
}
else if(server->os_version_code >= LINUX_VERSION_CODE(2, 4, 0))
{
return linux_2_4_0(server, buf, path);
linux_2_4_0(server, buf, path);
}
return FALSE;
}