aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-09-27 14:17:31 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-09-27 14:17:31 +0000
commit8dc4d8350bcf60e381ad7c9a4a74bb72ba72fd38 (patch)
tree10dd9d6a9ef0bab7345b7696f66fcf9339e6cce6 /libbb
parent093e184365e9e352bb08038450499cc14de7a492 (diff)
downloadbusybox-w32-8dc4d8350bcf60e381ad7c9a4a74bb72ba72fd38.tar.gz
busybox-w32-8dc4d8350bcf60e381ad7c9a4a74bb72ba72fd38.tar.bz2
busybox-w32-8dc4d8350bcf60e381ad7c9a4a74bb72ba72fd38.zip
process utilities related style cleanup
git-svn-id: svn://busybox.net/trunk/busybox@16233 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'libbb')
-rw-r--r--libbb/find_pid_by_name.c17
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 @@
23 * Returns a list of all matching PIDs 23 * Returns a list of all matching PIDs
24 * It is the caller's duty to free the returned pidlist. 24 * It is the caller's duty to free the returned pidlist.
25 */ 25 */
26long* find_pid_by_name( const char* pidName) 26long* find_pid_by_name(const char* pidName)
27{ 27{
28 long* pidList; 28 long* pidList;
29 int i=0; 29 int i = 0;
30 procps_status_t * p; 30 procps_status_t* p;
31 31
32 pidList = xmalloc(sizeof(long)); 32 pidList = xmalloc(sizeof(long));
33 while ((p = procps_scan(0)) != 0) 33 while ((p = procps_scan(0)) != 0) {
34 {
35 if (strncmp(p->short_cmd, pidName, COMM_LEN-1) == 0) { 34 if (strncmp(p->short_cmd, pidName, COMM_LEN-1) == 0) {
36 pidList=xrealloc( pidList, sizeof(long) * (i+2)); 35 pidList = xrealloc( pidList, sizeof(long) * (i+2));
37 pidList[i++]=p->pid; 36 pidList[i++] = p->pid;
38 } 37 }
39 } 38 }
40 39
@@ -44,9 +43,9 @@ long* find_pid_by_name( const char* pidName)
44 43
45long *pidlist_reverse(long *pidList) 44long *pidlist_reverse(long *pidList)
46{ 45{
47 int i=0; 46 int i = 0;
48 while (pidList[i] > 0 && ++i); 47 while (pidList[i] > 0 && ++i);
49 if ( i-- > 0) { 48 if (i-- > 0) {
50 long k; 49 long k;
51 int j; 50 int j;
52 for (j = 0; i > j; i--, j++) { 51 for (j = 0; i > j; i--, j++) {