whitespace clean up.
* *.{c,h} : whitespace clean up.
This commit is contained in:
@@ -49,7 +49,7 @@ struct _glibtop_machine
|
||||
kvm_t *kd;
|
||||
|
||||
kstat_ctl_t *kc;
|
||||
|
||||
|
||||
kstat_t *vminfo_kstat;
|
||||
hrtime_t vminfo_snaptime;
|
||||
vminfo_t vminfo;
|
||||
|
@@ -52,7 +52,7 @@ glibtop_init_mem_s (glibtop *server)
|
||||
void
|
||||
glibtop_get_mem_s (glibtop *server, glibtop_mem *buf)
|
||||
{
|
||||
kstat_ctl_t *kc = server->machine.kc;
|
||||
kstat_ctl_t *kc = server->machine.kc;
|
||||
kstat_t *ksp;
|
||||
kstat_named_t *kn;
|
||||
int pagesize = server->machine.pagesize;
|
||||
|
@@ -47,7 +47,7 @@ glibtop_init_p (glibtop *server, const unsigned long features,
|
||||
|
||||
for (init_fkt = _glibtop_init_hook_p; *init_fkt; init_fkt++)
|
||||
(*init_fkt) (server);
|
||||
|
||||
|
||||
server->flags |= _GLIBTOP_INIT_STATE_INIT;
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ glibtop_open_p (glibtop *server, const char *program_name,
|
||||
/* !!! WE ARE ROOT HERE - CHANGE WITH CAUTION !!! */
|
||||
|
||||
server->name = program_name;
|
||||
|
||||
|
||||
server->machine.uid = getuid ();
|
||||
server->machine.euid = geteuid ();
|
||||
server->machine.gid = getgid ();
|
||||
@@ -72,20 +72,20 @@ glibtop_open_p (glibtop *server, const char *program_name,
|
||||
glibtop_warn_io_r(server, "kvm_open()");
|
||||
|
||||
/* Drop priviledges; we only become root when necessary.
|
||||
|
||||
|
||||
setreuid (ruid, euid) - set real and effective user id;
|
||||
setregid (rgid, egid) - set real and effective group id;
|
||||
|
||||
|
||||
*/
|
||||
|
||||
|
||||
if (setreuid (server->machine.euid, server->machine.uid))
|
||||
_exit (1);
|
||||
|
||||
|
||||
if (setregid (server->machine.egid, server->machine.gid))
|
||||
_exit (1);
|
||||
|
||||
/* !!! END OF SUID ROOT PART !!! */
|
||||
|
||||
|
||||
/* Our effective uid is now those of the user invoking the server,
|
||||
so we do no longer have any priviledges.
|
||||
*/
|
||||
|
@@ -206,12 +206,12 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
|
||||
}
|
||||
|
||||
/* pids is now big enough to hold at least one single pid. */
|
||||
|
||||
|
||||
pids [count++] = pid;
|
||||
|
||||
total++;
|
||||
}
|
||||
|
||||
|
||||
s_closedir (proc);
|
||||
|
||||
/* count is only zero if an error occured (one a running Linux system,
|
||||
@@ -223,15 +223,15 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
|
||||
* g_malloc if pids_chain is NULL. We just calculate the
|
||||
* new size and copy pids to the beginning of the newly allocated
|
||||
* block. */
|
||||
|
||||
|
||||
new_size = pids_size + count * sizeof (unsigned);
|
||||
|
||||
|
||||
pids_chain = g_realloc (pids_chain, new_size);
|
||||
|
||||
|
||||
memcpy (pids_chain + pids_offset, pids, count * sizeof (unsigned));
|
||||
|
||||
|
||||
pids_size = new_size;
|
||||
|
||||
|
||||
pids_offset += BLOCK_COUNT;
|
||||
|
||||
/* Since everything is ok now, we can set buf->flags, fill in the
|
||||
|
@@ -74,7 +74,7 @@ glibtop_get_proc_map_s (glibtop *server, glibtop_proc_map *buf, pid_t pid)
|
||||
glibtop_map_entry *entry;
|
||||
struct stat inode;
|
||||
char buffer[BUFSIZ];
|
||||
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_proc_map));
|
||||
|
||||
#ifdef HAVE_PROCFS_H
|
||||
|
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <glibtop_private.h>
|
||||
|
||||
static const unsigned long _glibtop_sysdeps_proc_signal =
|
||||
static const unsigned long _glibtop_sysdeps_proc_signal =
|
||||
(1L << GLIBTOP_PROC_SIGNAL_SIGNAL) + (1L << GLIBTOP_PROC_SIGNAL_BLOCKED);
|
||||
|
||||
/* Init function. */
|
||||
@@ -51,7 +51,7 @@ glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf,
|
||||
int size;
|
||||
|
||||
memset (buf, 0, sizeof (glibtop_proc_signal));
|
||||
|
||||
|
||||
if(glibtop_get_proc_status_s(server, &pstatus, pid))
|
||||
return;
|
||||
|
||||
|
@@ -73,7 +73,7 @@ glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid)
|
||||
switch(psinfo.pr_state)
|
||||
#endif
|
||||
{
|
||||
case SONPROC:
|
||||
case SONPROC:
|
||||
#if (LIBGTOP_VERSION_CODE >= 1001002) && defined(HAVE_PROCFS_H)
|
||||
buf->has_cpu = 1;
|
||||
buf->processor = psinfo.pr_lwp.pr_onpro;
|
||||
|
Reference in New Issue
Block a user