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:
Benoît Dejean
2007-05-20 21:55:42 +00:00
committed by Benoît Dejean
parent ee78aaf29c
commit 6509ddff4c
24 changed files with 9 additions and 46 deletions

View File

@@ -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>
* proclist.c: (glibtop_get_proclist_s):

View File

@@ -73,8 +73,6 @@ glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf)
char buffer [BUFSIZ], *p;
int i;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_CPU, 0);
memset (buf, 0, sizeof (glibtop_cpu));
file_to_buffer(server, buffer, FILENAME);

View File

@@ -50,8 +50,6 @@ glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf)
{
char buffer [BUFSIZ], *p, *old;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_LOADAVG, 0);
memset (buf, 0, sizeof (glibtop_loadavg));
file_to_buffer(server, buffer, FILENAME);

View File

@@ -48,8 +48,6 @@ glibtop_get_mem_s (glibtop *server, glibtop_mem *buf)
{
char buffer [BUFSIZ];
glibtop_init_s (&server, GLIBTOP_SYSDEPS_MEM, 0);
memset(buf, 0, sizeof *buf);
file_to_buffer(server, buffer, FILENAME);

View File

@@ -46,8 +46,6 @@ glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf)
{
struct msginfo msginfo;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_MSG_LIMITS, 0);
memset (buf, 0, sizeof (glibtop_msg_limits));
msgctl (0, IPC_INFO, (void*) &msginfo);

View File

@@ -44,8 +44,6 @@ glibtop_get_netlist_s (glibtop *server, glibtop_netlist *buf)
FILE *f;
GPtrArray *devices;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_NETLIST, 0);
memset (buf, 0, sizeof (glibtop_netlist));
f = fopen("/proc/net/dev", "r");

View File

@@ -180,8 +180,6 @@ glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device)
{
int in, out, online;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PPP, 0);
memset (buf, 0, sizeof (glibtop_ppp));
if (is_ISDN_on (server, &online)) {

View File

@@ -47,8 +47,6 @@ glibtop_get_proc_args_s (glibtop *server, glibtop_proc_args *buf,
gsize length;
GError *error = NULL;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_ARGS, 0);
memset (buf, 0, sizeof (glibtop_proc_args));
sprintf (filename, "/proc/%d/cmdline", pid);

View File

@@ -47,8 +47,6 @@ glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf, pid_t pid)
{
char buffer [BUFSIZ], *p;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_KERNEL, 0);
memset (buf, 0, sizeof (glibtop_proc_kernel));
if (proc_stat_to_buffer (buffer, pid))

View File

@@ -66,8 +66,6 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
glibtop_proc_state procstate;
struct stat statb;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROCLIST, 0);
memset (buf, 0, sizeof (glibtop_proclist));
proc = opendir ("/proc");

View File

@@ -133,8 +133,6 @@ glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
char *line = NULL;
size_t line_size = 0;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_MAP, 0);
memset (buf, 0, sizeof (glibtop_proc_map));
has_smaps = server->os_version_code >= LINUX_VERSION_CODE(2, 6, 14);

View File

@@ -52,8 +52,6 @@ glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, pid_t pid)
char buffer [BUFSIZ], *p;
const size_t pagesize = get_page_size();
glibtop_init_s (&server, GLIBTOP_SYSDEPS_MEM, 0);
memset (buf, 0, sizeof (glibtop_proc_mem));
if (proc_stat_to_buffer (buffer, pid))

View File

@@ -182,8 +182,6 @@ glibtop_get_proc_open_files_s (glibtop *server, glibtop_proc_open_files *buf, pi
struct dirent *direntry;
DIR *dir;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_OPEN_FILES, 0);
memset (buf, 0, sizeof (glibtop_proc_open_files));
sprintf (fn, "/proc/%d/fd", pid);

View File

@@ -55,8 +55,6 @@ glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf,
char buffer [BUFSIZ], *p;
const size_t pagesize = get_page_size();
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_SEGMENT, 0);
memset (buf, 0, sizeof (glibtop_proc_segment));
if (proc_stat_to_buffer (buffer, pid))

View File

@@ -45,8 +45,6 @@ glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf, pid_t pid)
{
char buffer [BUFSIZ], *p;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_SIGNAL, 0);
memset (buf, 0, sizeof (glibtop_proc_signal));
if (proc_stat_to_buffer (buffer, pid))

View File

@@ -51,8 +51,6 @@ glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid)
char buffer [BUFSIZ], *p;
struct stat statb;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_STATE, 0);
memset (buf, 0, sizeof (glibtop_proc_state));
/* IMPORTANT NOTICE: For security reasons it is extremely important

View File

@@ -56,8 +56,6 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid)
char buffer [BUFSIZ], *p;
int i;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_TIME, 0);
memset (buf, 0, sizeof (glibtop_proc_time));
if (proc_stat_to_buffer (buffer, pid))

View File

@@ -53,8 +53,6 @@ glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf, pid_t pid)
{
char buffer [BUFSIZ], *p;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_PROC_UID, 0);
memset (buf, 0, sizeof (glibtop_proc_uid));
if (proc_status_to_buffer (buffer, pid))

View File

@@ -59,8 +59,6 @@ glibtop_get_proc_wd_s(glibtop *server, glibtop_proc_wd *buf, pid_t pid)
char dir[256];
DIR *task;
glibtop_init_s(&server, GLIBTOP_SYSDEPS_PROC_WD, 0);
memset(buf, 0, sizeof(glibtop_proc_wd));
g_snprintf(path, sizeof path, "/proc/%u/root", pid);

View File

@@ -63,8 +63,6 @@ glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf)
struct seminfo seminfo;
union semun arg;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_SEM_LIMITS, 0);
memset (buf, 0, sizeof (glibtop_sem_limits));
buf->flags = _glibtop_sysdeps_sem_limits;

View File

@@ -45,8 +45,6 @@ glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf)
{
struct shminfo shminfo;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_SHM_LIMITS, 0);
memset (buf, 0, sizeof (glibtop_shm_limits));
shmctl (0, IPC_INFO, (void *) &shminfo);

View File

@@ -54,8 +54,6 @@ glibtop_get_swap_s (glibtop *server, glibtop_swap *buf)
{
char buffer [BUFSIZ], *p;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_SWAP, 0);
memset (buf, 0, sizeof (glibtop_swap));
file_to_buffer(server, buffer, MEMINFO);

View File

@@ -41,8 +41,6 @@ init_sysinfo (glibtop *server)
if(G_LIKELY(sysinfo.flags)) return;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_CPU, 0);
file_to_buffer(server, buffer, FILENAME);
/* cpuinfo records are seperated by a blank line */

View File

@@ -49,8 +49,6 @@ glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf)
{
char buffer [BUFSIZ], *p;
glibtop_init_s (&server, GLIBTOP_SYSDEPS_UPTIME, 0);
memset (buf, 0, sizeof (glibtop_uptime));
file_to_buffer(server, buffer, FILENAME);