diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-09-27 18:17:31 +0400 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-09-27 18:17:31 +0400 |
commit | be905d550c96da8c75d697842ba4169a62d05190 (patch) | |
tree | 10dd9d6a9ef0bab7345b7696f66fcf9339e6cce6 /libbb/find_pid_by_name.c | |
parent | 2f4399c6cc966d39ba74fc4727a0493b3b52ffd8 (diff) |
process utilities related style cleanup
Diffstat (limited to 'libbb/find_pid_by_name.c')
-rw-r--r-- | libbb/find_pid_by_name.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/libbb/find_pid_by_name.c b/libbb/find_pid_by_name.c index 5520220b3..247d79f9f 100644 --- a/libbb/find_pid_by_name.c +++ b/libbb/find_pid_by_name.c @@ -23,18 +23,17 @@ * Returns a list of all matching PIDs * It is the caller's duty to free the returned pidlist. */ -long* find_pid_by_name( const char* pidName) +long* find_pid_by_name(const char* pidName) { long* pidList; - int i=0; - procps_status_t * p; + int i = 0; + 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; + pidList = xrealloc( pidList, sizeof(long) * (i+2)); + pidList[i++] = p->pid; } } @@ -44,9 +43,9 @@ long* find_pid_by_name( const char* pidName) long *pidlist_reverse(long *pidList) { - int i=0; + int i = 0; while (pidList[i] > 0 && ++i); - if ( i-- > 0) { + if (i-- > 0) { long k; int j; for (j = 0; i > j; i--, j++) { |