Indent to 4 spaces.

This commit is contained in:
Martin Baulig
1999-12-25 19:04:22 +00:00
parent bbb539ef56
commit e7b42a66b1

View File

@@ -73,10 +73,8 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
/* Check if the user wanted only one process */ /* Check if the user wanted only one process */
if(which == GLIBTOP_KERN_PROC_PID) if(which == GLIBTOP_KERN_PROC_PID) {
{ if(mask) {
if(mask)
{
#ifdef HAVE_PROCFS_H #ifdef HAVE_PROCFS_H
struct psinfo psinfo; struct psinfo psinfo;
#else #else
@@ -90,9 +88,7 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
return NULL; return NULL;
if(mask & GLIBTOP_EXCLUDE_NOTTY && psinfo.pr_ttydev == PRNODEV) if(mask & GLIBTOP_EXCLUDE_NOTTY && psinfo.pr_ttydev == PRNODEV)
return NULL; return NULL;
} } else {
else
{
sprintf(buffer, "/proc/%d", arg); sprintf(buffer, "/proc/%d", arg);
if(s_stat(buffer, &statb) < 0) if(s_stat(buffer, &statb) < 0)
return NULL; return NULL;
@@ -138,8 +134,7 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
like this for LP64 process, because stat() will fail. like this for LP64 process, because stat() will fail.
XXX Unimplemented for now */ XXX Unimplemented for now */
if(!mask && which == GLIBTOP_KERN_PROC_RUID) if(!mask && which == GLIBTOP_KERN_PROC_RUID) {
{
sprintf (buffer, "/proc/%d", pid); sprintf (buffer, "/proc/%d", pid);
if (s_stat (buffer, &statb)) continue; if (s_stat (buffer, &statb)) continue;
@@ -148,14 +143,12 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
if(statb.st_uid != arg) continue; if(statb.st_uid != arg) continue;
} }
if(mask || which != GLIBTOP_KERN_PROC_ALL) if(mask || which != GLIBTOP_KERN_PROC_ALL) {
{
struct psinfo psinfo; struct psinfo psinfo;
if(glibtop_get_proc_data_psinfo_s(server, &psinfo, pid)) if(glibtop_get_proc_data_psinfo_s(server, &psinfo, pid))
continue; continue;
if(mask) if(mask) {
{
if(mask & GLIBTOP_EXCLUDE_IDLE && !psinfo.pr_pctcpu) if(mask & GLIBTOP_EXCLUDE_IDLE && !psinfo.pr_pctcpu)
continue; continue;
if(mask & GLIBTOP_EXCLUDE_SYSTEM && psinfo.pr_flag & SSYS) if(mask & GLIBTOP_EXCLUDE_SYSTEM && psinfo.pr_flag & SSYS)
@@ -164,24 +157,29 @@ glibtop_get_proclist_s (glibtop *server, glibtop_proclist *buf,
&& psinfo.pr_ttydev == PRNODEV) && psinfo.pr_ttydev == PRNODEV)
continue; continue;
} }
switch(which) switch(which) {
{ case GLIBTOP_KERN_PROC_PGRP:
case GLIBTOP_KERN_PROC_PGRP: if(psinfo.pr_pgid != arg) if(psinfo.pr_pgid != arg)
continue; continue;
break; break;
case GLIBTOP_KERN_PROC_SESSION: if(psinfo.pr_sid != arg) case GLIBTOP_KERN_PROC_SESSION:
if(psinfo.pr_sid != arg)
continue; continue;
break; break;
case GLIBTOP_KERN_PROC_TTY: if(psinfo.pr_ttydev != arg) case GLIBTOP_KERN_PROC_TTY:
if(psinfo.pr_ttydev != arg)
continue; continue;
break; break;
case GLIBTOP_KERN_PROC_UID: if(psinfo.pr_euid != arg) case GLIBTOP_KERN_PROC_UID:
if(psinfo.pr_euid != arg)
continue; continue;
break; break;
case GLIBTOP_KERN_PROC_RUID: if(psinfo.pr_uid != arg) case GLIBTOP_KERN_PROC_RUID:
if(psinfo.pr_uid != arg)
continue; continue;
break; break;
default: break; default:
break;
} }
} }
#endif #endif