aboutsummaryrefslogtreecommitdiff
path: root/ps.c
diff options
context:
space:
mode:
Diffstat (limited to 'ps.c')
-rw-r--r--ps.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ps.c b/ps.c
index 8d59700fd..f8cf33b25 100644
--- a/ps.c
+++ b/ps.c
@@ -163,13 +163,13 @@ extern int ps_main(int argc, char **argv)
163 if (*groupName == '\0') 163 if (*groupName == '\0')
164 sprintf(groupName, "%d", p.rgid); 164 sprintf(groupName, "%d", p.rgid);
165 165
166 len = fprintf(stdout, "%5d %-8s %-8s %c ", p.pid, uidName, groupName,
167 p.state);
168 sprintf(path, "/proc/%s/cmdline", entry->d_name); 166 sprintf(path, "/proc/%s/cmdline", entry->d_name);
169 file = fopen(path, "r"); 167 file = fopen(path, "r");
170 if (file == NULL) 168 if (file == NULL)
171 fatalError("Can't open %s: %s\n", path, strerror(errno)); 169 continue;
172 i = 0; 170 i = 0;
171 len = fprintf(stdout, "%5d %-8s %-8s %c ", p.pid, uidName, groupName,
172 p.state);
173 while (((c = getc(file)) != EOF) && (i < (terminal_width-len))) { 173 while (((c = getc(file)) != EOF) && (i < (terminal_width-len))) {
174 i++; 174 i++;
175 if (c == '\0') 175 if (c == '\0')