From 35fb51272863c8723a40e59d2024c7f4c9ec8946 Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Wed, 1 Nov 2006 09:16:49 +0000 Subject: PID should be stored in pid_t, not int or long. find_pid_by_name() was returning 0 or -1 in last array element, but -1 was never checked. We can use just 0 intead. --- include/libbb.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'include/libbb.h') diff --git a/include/libbb.h b/include/libbb.h index 770c1ecc1..343a93290 100644 --- a/include/libbb.h +++ b/include/libbb.h @@ -501,11 +501,10 @@ void reset_ino_dev_hashtable(void); #endif #endif typedef struct { - int pid; + pid_t pid, ppid; char user[9]; char state[4]; unsigned long rss; - int ppid; #ifdef CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE unsigned pcpu; unsigned pscpu; @@ -518,8 +517,8 @@ typedef struct { char short_cmd[COMM_LEN]; } procps_status_t; procps_status_t* procps_scan(int save_user_arg0); -long *find_pid_by_name( const char* pidName); -long *pidlist_reverse(long *pidList); +pid_t *find_pid_by_name(const char* procName); +pid_t *pidlist_reverse(pid_t *pidList); extern const char bb_uuenc_tbl_base64[]; -- cgit v1.2.3