aboutsummaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-10-09 19:47:01 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2009-10-09 19:47:01 +0200
commita05b2b856bf095dfd5f575c106d1a9e5ac6edd3c (patch)
treea98223832e6a794f5b54e9b2f8793f28f78c6721 /procps
parentdea478855f8de7fe0974f5cbb5fa3f5968c46302 (diff)
downloadbusybox-w32-a05b2b856bf095dfd5f575c106d1a9e5ac6edd3c.tar.gz
busybox-w32-a05b2b856bf095dfd5f575c106d1a9e5ac6edd3c.tar.bz2
busybox-w32-a05b2b856bf095dfd5f575c106d1a9e5ac6edd3c.zip
ps: show longer COMMAND
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'procps')
-rw-r--r--procps/ps.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/procps/ps.c b/procps/ps.c
index d86ac6d2f..e94004541 100644
--- a/procps/ps.c
+++ b/procps/ps.c
@@ -303,7 +303,7 @@ static const ps_out_t out_spec[] = {
303 { 8 , "user" ,"USER" ,func_user ,PSSCAN_UIDGID }, 303 { 8 , "user" ,"USER" ,func_user ,PSSCAN_UIDGID },
304 { 8 , "group" ,"GROUP" ,func_group ,PSSCAN_UIDGID }, 304 { 8 , "group" ,"GROUP" ,func_group ,PSSCAN_UIDGID },
305 { 16 , "comm" ,"COMMAND",func_comm ,PSSCAN_COMM }, 305 { 16 , "comm" ,"COMMAND",func_comm ,PSSCAN_COMM },
306 { 256 , "args" ,"COMMAND",func_args ,PSSCAN_COMM }, 306 { MAX_WIDTH , "args" ,"COMMAND",func_args ,PSSCAN_COMM },
307 { 5 , "pid" ,"PID" ,func_pid ,PSSCAN_PID }, 307 { 5 , "pid" ,"PID" ,func_pid ,PSSCAN_PID },
308 { 5 , "ppid" ,"PPID" ,func_ppid ,PSSCAN_PPID }, 308 { 5 , "ppid" ,"PPID" ,func_ppid ,PSSCAN_PPID },
309 { 5 , "pgid" ,"PGID" ,func_pgid ,PSSCAN_PGID }, 309 { 5 , "pgid" ,"PGID" ,func_pgid ,PSSCAN_PGID },
@@ -383,7 +383,7 @@ static void parse_o(char* opt)
383 print_header = 1; 383 print_header = 1;
384} 384}
385 385
386static void post_process(void) 386static void alloc_line_buffer(void)
387{ 387{
388 int i; 388 int i;
389 int width = 0; 389 int width = 0;
@@ -393,6 +393,12 @@ static void post_process(void)
393 print_header = 1; 393 print_header = 1;
394 } 394 }
395 width += out[i].width + 1; /* "FIELD " */ 395 width += out[i].width + 1; /* "FIELD " */
396 if ((int)(width - terminal_width) > 0) {
397 /* The rest does not fit on the screen */
398 //out[i].width -= (width - terminal_width - 1);
399 out_cnt = i + 1;
400 break;
401 }
396 } 402 }
397#if ENABLE_SELINUX 403#if ENABLE_SELINUX
398 if (!is_selinux_enabled()) 404 if (!is_selinux_enabled())
@@ -497,7 +503,6 @@ int ps_main(int argc UNUSED_PARAM, char **argv)
497 } 503 }
498 parse_o(default_o); 504 parse_o(default_o);
499 } 505 }
500 post_process();
501#if ENABLE_FEATURE_SHOW_THREADS 506#if ENABLE_FEATURE_SHOW_THREADS
502 if (opt & OPT_T) 507 if (opt & OPT_T)
503 need_flags |= PSSCAN_TASKS; 508 need_flags |= PSSCAN_TASKS;
@@ -511,6 +516,7 @@ int ps_main(int argc UNUSED_PARAM, char **argv)
511 if (--terminal_width > MAX_WIDTH) 516 if (--terminal_width > MAX_WIDTH)
512 terminal_width = MAX_WIDTH; 517 terminal_width = MAX_WIDTH;
513 } 518 }
519 alloc_line_buffer();
514 format_header(); 520 format_header();
515 521
516 p = NULL; 522 p = NULL;