Got rid of glibtop_init_s calls. If i'm right, these are only no-op and
2007-05-20 Benoît Dejean <benoit@placenet.org> * *.c: Got rid of glibtop_init_s calls. If i'm right, these are only no-op and the legacy stub/ don't have any calls to them, so it's should harmless. So let's try it. svn path=/trunk/; revision=2598
This commit is contained in:
committed by
Benoît Dejean
parent
ee78aaf29c
commit
6509ddff4c
@@ -1,3 +1,12 @@
|
|||||||
|
2007-05-20 Benoît Dejean <benoit@placenet.org>
|
||||||
|
|
||||||
|
* *.c:
|
||||||
|
|
||||||
|
Got rid of glibtop_init_s calls.
|
||||||
|
If i'm right, these are only no-op and the legacy stub/ don't
|
||||||
|
have any calls to them, so it's should harmless.
|
||||||
|
So let's try it.
|
||||||
|
|
||||||
2007-05-19 Benoît Dejean <benoit@placenet.org>
|
2007-05-19 Benoît Dejean <benoit@placenet.org>
|
||||||
|
|
||||||
* proclist.c: (glibtop_get_proclist_s):
|
* proclist.c: (glibtop_get_proclist_s):
|
||||||
|
@@ -73,8 +73,6 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
|
|||||||
char buffer [BUFSIZ], *p;
|
char buffer [BUFSIZ], *p;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_CPU, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_cpu));
|
memset (buf, 0, sizeof (glibtop_cpu));
|
||||||
|
|
||||||
file_to_buffer(server, buffer, FILENAME);
|
file_to_buffer(server, buffer, FILENAME);
|
||||||
|
@@ -50,8 +50,6 @@ glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf)
|
|||||||
{
|
{
|
||||||
char buffer [BUFSIZ], *p, *old;
|
char buffer [BUFSIZ], *p, *old;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_LOADAVG, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_loadavg));
|
memset (buf, 0, sizeof (glibtop_loadavg));
|
||||||
|
|
||||||
file_to_buffer(server, buffer, FILENAME);
|
file_to_buffer(server, buffer, FILENAME);
|
||||||
|
@@ -48,8 +48,6 @@ glibtop_get_mem_s (glibtop *server, glibtop_mem *buf)
|
|||||||
{
|
{
|
||||||
char buffer [BUFSIZ];
|
char buffer [BUFSIZ];
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_MEM, 0);
|
|
||||||
|
|
||||||
memset(buf, 0, sizeof *buf);
|
memset(buf, 0, sizeof *buf);
|
||||||
|
|
||||||
file_to_buffer(server, buffer, FILENAME);
|
file_to_buffer(server, buffer, FILENAME);
|
||||||
|
@@ -46,8 +46,6 @@ glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf)
|
|||||||
{
|
{
|
||||||
struct msginfo msginfo;
|
struct msginfo msginfo;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_MSG_LIMITS, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_msg_limits));
|
memset (buf, 0, sizeof (glibtop_msg_limits));
|
||||||
|
|
||||||
msgctl (0, IPC_INFO, (void*) &msginfo);
|
msgctl (0, IPC_INFO, (void*) &msginfo);
|
||||||
|
@@ -44,8 +44,6 @@ glibtop_get_netlist_s (glibtop *server, glibtop_netlist *buf)
|
|||||||
FILE *f;
|
FILE *f;
|
||||||
GPtrArray *devices;
|
GPtrArray *devices;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_NETLIST, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_netlist));
|
memset (buf, 0, sizeof (glibtop_netlist));
|
||||||
|
|
||||||
f = fopen("/proc/net/dev", "r");
|
f = fopen("/proc/net/dev", "r");
|
||||||
|
@@ -180,8 +180,6 @@ glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device)
|
|||||||
{
|
{
|
||||||
int in, out, online;
|
int in, out, online;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PPP, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_ppp));
|
memset (buf, 0, sizeof (glibtop_ppp));
|
||||||
|
|
||||||
if (is_ISDN_on (server, &online)) {
|
if (is_ISDN_on (server, &online)) {
|
||||||
|
@@ -47,8 +47,6 @@ glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf,
|
|||||||
gsize length;
|
gsize length;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_ARGS, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_args));
|
memset (buf, 0, sizeof (glibtop_proc_args));
|
||||||
|
|
||||||
sprintf (filename, "/proc/%d/cmdline", pid);
|
sprintf (filename, "/proc/%d/cmdline", pid);
|
||||||
|
@@ -47,8 +47,6 @@ glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf, pid_t pid)
|
|||||||
{
|
{
|
||||||
char buffer [BUFSIZ], *p;
|
char buffer [BUFSIZ], *p;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_KERNEL, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_kernel));
|
memset (buf, 0, sizeof (glibtop_proc_kernel));
|
||||||
|
|
||||||
if (proc_stat_to_buffer (buffer, pid))
|
if (proc_stat_to_buffer (buffer, pid))
|
||||||
|
@@ -66,8 +66,6 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
|
|||||||
glibtop_proc_state procstate;
|
glibtop_proc_state procstate;
|
||||||
struct stat statb;
|
struct stat statb;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROCLIST, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proclist));
|
memset (buf, 0, sizeof (glibtop_proclist));
|
||||||
|
|
||||||
proc = opendir ("/proc");
|
proc = opendir ("/proc");
|
||||||
|
@@ -133,8 +133,6 @@ glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
|
|||||||
char *line = NULL;
|
char *line = NULL;
|
||||||
size_t line_size = 0;
|
size_t line_size = 0;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_MAP, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_map));
|
memset (buf, 0, sizeof (glibtop_proc_map));
|
||||||
|
|
||||||
has_smaps = server->os_version_code >= LINUX_VERSION_CODE(2, 6, 14);
|
has_smaps = server->os_version_code >= LINUX_VERSION_CODE(2, 6, 14);
|
||||||
|
@@ -52,8 +52,6 @@ glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, pid_t pid)
|
|||||||
char buffer [BUFSIZ], *p;
|
char buffer [BUFSIZ], *p;
|
||||||
const size_t pagesize = get_page_size();
|
const size_t pagesize = get_page_size();
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_MEM, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_mem));
|
memset (buf, 0, sizeof (glibtop_proc_mem));
|
||||||
|
|
||||||
if (proc_stat_to_buffer (buffer, pid))
|
if (proc_stat_to_buffer (buffer, pid))
|
||||||
|
@@ -182,8 +182,6 @@ glibtop_get_proc_open_files_s (glibtop *server, glibtop_proc_open_files *buf, pi
|
|||||||
struct dirent *direntry;
|
struct dirent *direntry;
|
||||||
DIR *dir;
|
DIR *dir;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_OPEN_FILES, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_open_files));
|
memset (buf, 0, sizeof (glibtop_proc_open_files));
|
||||||
|
|
||||||
sprintf (fn, "/proc/%d/fd", pid);
|
sprintf (fn, "/proc/%d/fd", pid);
|
||||||
|
@@ -55,8 +55,6 @@ glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf,
|
|||||||
char buffer [BUFSIZ], *p;
|
char buffer [BUFSIZ], *p;
|
||||||
const size_t pagesize = get_page_size();
|
const size_t pagesize = get_page_size();
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_SEGMENT, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_segment));
|
memset (buf, 0, sizeof (glibtop_proc_segment));
|
||||||
|
|
||||||
if (proc_stat_to_buffer (buffer, pid))
|
if (proc_stat_to_buffer (buffer, pid))
|
||||||
|
@@ -45,8 +45,6 @@ glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf, pid_t pid)
|
|||||||
{
|
{
|
||||||
char buffer [BUFSIZ], *p;
|
char buffer [BUFSIZ], *p;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_SIGNAL, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_signal));
|
memset (buf, 0, sizeof (glibtop_proc_signal));
|
||||||
|
|
||||||
if (proc_stat_to_buffer (buffer, pid))
|
if (proc_stat_to_buffer (buffer, pid))
|
||||||
|
@@ -51,8 +51,6 @@ glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid)
|
|||||||
char buffer [BUFSIZ], *p;
|
char buffer [BUFSIZ], *p;
|
||||||
struct stat statb;
|
struct stat statb;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_STATE, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_state));
|
memset (buf, 0, sizeof (glibtop_proc_state));
|
||||||
|
|
||||||
/* IMPORTANT NOTICE: For security reasons it is extremely important
|
/* IMPORTANT NOTICE: For security reasons it is extremely important
|
||||||
|
@@ -56,8 +56,6 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid)
|
|||||||
char buffer [BUFSIZ], *p;
|
char buffer [BUFSIZ], *p;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_TIME, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_time));
|
memset (buf, 0, sizeof (glibtop_proc_time));
|
||||||
|
|
||||||
if (proc_stat_to_buffer (buffer, pid))
|
if (proc_stat_to_buffer (buffer, pid))
|
||||||
|
@@ -53,8 +53,6 @@ glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf, pid_t pid)
|
|||||||
{
|
{
|
||||||
char buffer [BUFSIZ], *p;
|
char buffer [BUFSIZ], *p;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_UID, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_proc_uid));
|
memset (buf, 0, sizeof (glibtop_proc_uid));
|
||||||
|
|
||||||
if (proc_status_to_buffer (buffer, pid))
|
if (proc_status_to_buffer (buffer, pid))
|
||||||
|
@@ -59,8 +59,6 @@ glibtop_get_proc_wd_s(glibtop *server, glibtop_proc_wd *buf, pid_t pid)
|
|||||||
char dir[256];
|
char dir[256];
|
||||||
DIR *task;
|
DIR *task;
|
||||||
|
|
||||||
glibtop_init_s(&server, GLIBTOP_SYSDEPS_PROC_WD, 0);
|
|
||||||
|
|
||||||
memset(buf, 0, sizeof(glibtop_proc_wd));
|
memset(buf, 0, sizeof(glibtop_proc_wd));
|
||||||
|
|
||||||
g_snprintf(path, sizeof path, "/proc/%u/root", pid);
|
g_snprintf(path, sizeof path, "/proc/%u/root", pid);
|
||||||
|
@@ -63,8 +63,6 @@ glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf)
|
|||||||
struct seminfo seminfo;
|
struct seminfo seminfo;
|
||||||
union semun arg;
|
union semun arg;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_SEM_LIMITS, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_sem_limits));
|
memset (buf, 0, sizeof (glibtop_sem_limits));
|
||||||
|
|
||||||
buf->flags = _glibtop_sysdeps_sem_limits;
|
buf->flags = _glibtop_sysdeps_sem_limits;
|
||||||
|
@@ -45,8 +45,6 @@ glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf)
|
|||||||
{
|
{
|
||||||
struct shminfo shminfo;
|
struct shminfo shminfo;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_SHM_LIMITS, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_shm_limits));
|
memset (buf, 0, sizeof (glibtop_shm_limits));
|
||||||
|
|
||||||
shmctl (0, IPC_INFO, (void *) &shminfo);
|
shmctl (0, IPC_INFO, (void *) &shminfo);
|
||||||
|
@@ -54,8 +54,6 @@ glibtop_get_swap_s (glibtop *server, glibtop_swap *buf)
|
|||||||
{
|
{
|
||||||
char buffer [BUFSIZ], *p;
|
char buffer [BUFSIZ], *p;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_SWAP, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_swap));
|
memset (buf, 0, sizeof (glibtop_swap));
|
||||||
|
|
||||||
file_to_buffer(server, buffer, MEMINFO);
|
file_to_buffer(server, buffer, MEMINFO);
|
||||||
|
@@ -41,8 +41,6 @@ init_sysinfo (glibtop *server)
|
|||||||
|
|
||||||
if(G_LIKELY(sysinfo.flags)) return;
|
if(G_LIKELY(sysinfo.flags)) return;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_CPU, 0);
|
|
||||||
|
|
||||||
file_to_buffer(server, buffer, FILENAME);
|
file_to_buffer(server, buffer, FILENAME);
|
||||||
|
|
||||||
/* cpuinfo records are seperated by a blank line */
|
/* cpuinfo records are seperated by a blank line */
|
||||||
|
@@ -49,8 +49,6 @@ glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf)
|
|||||||
{
|
{
|
||||||
char buffer [BUFSIZ], *p;
|
char buffer [BUFSIZ], *p;
|
||||||
|
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_UPTIME, 0);
|
|
||||||
|
|
||||||
memset (buf, 0, sizeof (glibtop_uptime));
|
memset (buf, 0, sizeof (glibtop_uptime));
|
||||||
|
|
||||||
file_to_buffer(server, buffer, FILENAME);
|
file_to_buffer(server, buffer, FILENAME);
|
||||||
|
Reference in New Issue
Block a user