aboutsummaryrefslogtreecommitdiff
path: root/ps.c
diff options
context:
space:
mode:
Diffstat (limited to 'ps.c')
-rw-r--r--ps.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/ps.c b/ps.c
index 79910fe34..357ece383 100644
--- a/ps.c
+++ b/ps.c
@@ -121,8 +121,8 @@ extern int ps_main(int argc, char **argv)
121 FILE *file; 121 FILE *file;
122 struct dirent *entry; 122 struct dirent *entry;
123 char path[32], sbuf[512]; 123 char path[32], sbuf[512];
124 char uidName[10] = ""; 124 char uidName[9];
125 char groupName[10] = ""; 125 char groupName[9];
126 int len, i, c; 126 int len, i, c;
127#ifdef BB_FEATURE_AUTOWIDTH 127#ifdef BB_FEATURE_AUTOWIDTH
128 struct winsize win = { 0, 0, 0, 0 }; 128 struct winsize win = { 0, 0, 0, 0 };
@@ -146,9 +146,6 @@ extern int ps_main(int argc, char **argv)
146 fprintf(stdout, "%5s %-8s %-3s %5s %s\n", "PID", "Uid", "Gid", 146 fprintf(stdout, "%5s %-8s %-3s %5s %s\n", "PID", "Uid", "Gid",
147 "State", "Command"); 147 "State", "Command");
148 while ((entry = readdir(dir)) != NULL) { 148 while ((entry = readdir(dir)) != NULL) {
149 uidName[0] = '\0';
150 groupName[0] = '\0';
151
152 if (!isdigit(*entry->d_name)) 149 if (!isdigit(*entry->d_name))
153 continue; 150 continue;
154 sprintf(path, "/proc/%s/status", entry->d_name); 151 sprintf(path, "/proc/%s/status", entry->d_name);
@@ -204,8 +201,8 @@ extern int ps_main(int argc, char **argv)
204 pid_t num_pids; 201 pid_t num_pids;
205 pid_t* pid_array = NULL; 202 pid_t* pid_array = NULL;
206 struct pid_info info; 203 struct pid_info info;
207 char uidName[10] = ""; 204 char uidName[9];
208 char groupName[10] = ""; 205 char groupName[9];
209#ifdef BB_FEATURE_AUTOWIDTH 206#ifdef BB_FEATURE_AUTOWIDTH
210 struct winsize win = { 0, 0, 0, 0 }; 207 struct winsize win = { 0, 0, 0, 0 };
211 int terminal_width = TERMINAL_WIDTH; 208 int terminal_width = TERMINAL_WIDTH;
@@ -247,8 +244,6 @@ extern int ps_main(int argc, char **argv)
247 "State", "Command"); 244 "State", "Command");
248 245
249 for (i=1; i<pid_array[0] ; i++) { 246 for (i=1; i<pid_array[0] ; i++) {
250 uidName[0] = '\0';
251 groupName[0] = '\0';
252 info.pid = pid_array[i]; 247 info.pid = pid_array[i];
253 248
254 if (ioctl (fd, DEVPS_GET_PID_INFO, &info)<0) 249 if (ioctl (fd, DEVPS_GET_PID_INFO, &info)<0)