New has_sysfs function to avoid stating over and over '/sys' on each

2006-07-27  Benoît Dejean  <benoit@placenet.org>

        * glibtop_private.c: (has_sysfs):
        * glibtop_private.h:
        * netload.c: (glibtop_get_netload_s):
        * open.c: (set_linux_version):

        New has_sysfs function to avoid stating
        over and over '/sys' on each netload call.
This commit is contained in:
Benoît Dejean
2006-07-27 09:23:32 +00:00
committed by Benoît Dejean
parent 3345ef1704
commit d497c25081
5 changed files with 31 additions and 2 deletions

View File

@@ -50,7 +50,7 @@ static void set_linux_version(glibtop *server)
uts.release, x, y, z, LINUX_VERSION_CODE(x,y,z));
if (LINUX_VERSION_CODE(x, y, z) >= LINUX_VERSION_CODE(2, 6, 0)
&& !g_file_test("/sys", G_FILE_TEST_IS_DIR))
&& !has_sysfs())
glibtop_warn_r(server,
"You're running a 2.6 kernel without /sys."
"You should mount it.");