process utilities related style cleanup
This commit is contained in:
parent
2f4399c6cc
commit
be905d550c
@ -30,8 +30,7 @@ long* find_pid_by_name( const char* pidName)
|
||||
procps_status_t* p;
|
||||
|
||||
pidList = xmalloc(sizeof(long));
|
||||
while ((p = procps_scan(0)) != 0)
|
||||
{
|
||||
while ((p = procps_scan(0)) != 0) {
|
||||
if (strncmp(p->short_cmd, pidName, COMM_LEN-1) == 0) {
|
||||
pidList = xrealloc( pidList, sizeof(long) * (i+2));
|
||||
pidList[i++] = p->pid;
|
||||
|
@ -57,16 +57,15 @@ int ps_main(int argc, char **argv)
|
||||
|
||||
#if ENABLE_SELINUX
|
||||
if (use_selinux)
|
||||
printf(" PID Context Stat Command\n");
|
||||
puts(" PID Context Stat Command");
|
||||
else
|
||||
#endif
|
||||
printf(" PID Uid VmSize Stat Command\n");
|
||||
puts(" PID Uid VmSize Stat Command");
|
||||
|
||||
while ((p = procps_scan(1)) != 0) {
|
||||
char *namecmd = p->cmd;
|
||||
#if ENABLE_SELINUX
|
||||
if (use_selinux)
|
||||
{
|
||||
if (use_selinux) {
|
||||
char sbuf[128];
|
||||
len = sizeof(sbuf);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user