summaryrefslogtreecommitdiff
path: root/sysdeps/linux/glibtop_server.h
diff options
context:
space:
mode:
authorBenoît Dejean <bdejean@src.gnome.org>2004-06-18 07:24:58 +0000
committerBenoît Dejean <bdejean@src.gnome.org>2004-06-18 07:24:58 +0000
commite12ac5f40c165bc5c1751b4f40d2569126483b79 (patch)
treebd7de0da3de691072477f3da9a7ebbc74ca836c6 /sysdeps/linux/glibtop_server.h
parent34e322e7c26924b083da3355e127753c68baf8da (diff)
downloadlibgtop-e12ac5f40c165bc5c1751b4f40d2569126483b79.tar.gz
Whitespace cleanup.
* loadavg.c: (glibtop_get_loadavg_s): Whitespace cleanup. * ppp.c: (get_ISDN_stats), (is_ISDN_on): Replace g_malloc by an array. * glibtop_server.c: (get_pageshift): * glibtop_server.h: * procmem.c: (glibtop_init_proc_mem_s), (glibtop_get_proc_mem_s): * procsegment.c: (glibtop_init_proc_segment_s), (glibtop_get_proc_segment_s): Moved the pageshift calculation to glibtop_server.[ch] * procstate.c: (glibtop_get_proc_state_s): * procuid.c: (glibtop_get_proc_uid_s): * sysinfo.c: (init_sysinfo): Minor cleanups.
Diffstat (limited to 'sysdeps/linux/glibtop_server.h')
-rw-r--r--sysdeps/linux/glibtop_server.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/sysdeps/linux/glibtop_server.h b/sysdeps/linux/glibtop_server.h
index 0946cf1e..a522cefb 100644
--- a/sysdeps/linux/glibtop_server.h
+++ b/sysdeps/linux/glibtop_server.h
@@ -24,9 +24,11 @@
#ifndef __GLIBTOP_SERVER_H__
#define __GLIBTOP_SERVER_H__
+#include <glib.h>
#include <fcntl.h>
#include <ctype.h>
+#include <string.h>
G_BEGIN_DECLS
@@ -34,6 +36,8 @@ G_BEGIN_DECLS
#define LINUX_VERSION(x,y,z) (0x10000*(x) + 0x100*(y) + z)
+unsigned get_pageshift();
+
static inline char *
skip_token (const char *p)
{
@@ -87,9 +91,8 @@ static inline char *
proc_stat_after_cmd (char *p)
{
p = strrchr (p, ')');
- if (!p) return p;
-
- *p++ = '\0';
+ if (G_LIKELY(p))
+ *p++ = '\0';
return p;
}