diff options
author | Ron Yorston <rmy@pobox.com> | 2017-02-08 20:09:29 +0000 |
---|---|---|
committer | Ron Yorston <rmy@pobox.com> | 2017-02-08 20:09:29 +0000 |
commit | 373275a708bafb88fa4f0519de2166154f44fed9 (patch) | |
tree | 4587b4fd3f695e0f3705b2a217e199f3144df931 /libbb/procps.c | |
parent | b74b2619779b1deb903b7766261807df1e9b1f7f (diff) | |
parent | c2b18583a3df06aeecf535c3cea6856aa1f2e205 (diff) | |
download | busybox-w32-373275a708bafb88fa4f0519de2166154f44fed9.tar.gz busybox-w32-373275a708bafb88fa4f0519de2166154f44fed9.tar.bz2 busybox-w32-373275a708bafb88fa4f0519de2166154f44fed9.zip |
Merge branch 'busybox' into merge
Diffstat (limited to 'libbb/procps.c')
-rw-r--r-- | libbb/procps.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/libbb/procps.c b/libbb/procps.c index 452b50b82..6f971a116 100644 --- a/libbb/procps.c +++ b/libbb/procps.c | |||
@@ -371,6 +371,7 @@ procps_status_t* FAST_FUNC procps_scan(procps_status_t* sp, int flags) | |||
371 | | PSSCAN_TTY | PSSCAN_NICE | 371 | | PSSCAN_TTY | PSSCAN_NICE |
372 | | PSSCAN_CPU) | 372 | | PSSCAN_CPU) |
373 | ) { | 373 | ) { |
374 | int s_idx; | ||
374 | char *cp, *comm1; | 375 | char *cp, *comm1; |
375 | int tty; | 376 | int tty; |
376 | #if !ENABLE_FEATURE_FAST_TOP | 377 | #if !ENABLE_FEATURE_FAST_TOP |
@@ -469,17 +470,20 @@ procps_status_t* FAST_FUNC procps_scan(procps_status_t* sp, int flags) | |||
469 | #if ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS | 470 | #if ENABLE_FEATURE_PS_ADDITIONAL_COLUMNS |
470 | sp->niceness = tasknice; | 471 | sp->niceness = tasknice; |
471 | #endif | 472 | #endif |
472 | 473 | sp->state[1] = ' '; | |
473 | if (sp->vsz == 0 && sp->state[0] != 'Z') | 474 | sp->state[2] = ' '; |
475 | s_idx = 1; | ||
476 | if (sp->vsz == 0 && sp->state[0] != 'Z') { | ||
477 | /* not sure what the purpose of this flag */ | ||
474 | sp->state[1] = 'W'; | 478 | sp->state[1] = 'W'; |
475 | else | 479 | s_idx = 2; |
476 | sp->state[1] = ' '; | 480 | } |
477 | if (tasknice < 0) | 481 | if (tasknice != 0) { |
478 | sp->state[2] = '<'; | 482 | if (tasknice < 0) |
479 | else if (tasknice) /* > 0 */ | 483 | sp->state[s_idx] = '<'; |
480 | sp->state[2] = 'N'; | 484 | else /* > 0 */ |
481 | else | 485 | sp->state[s_idx] = 'N'; |
482 | sp->state[2] = ' '; | 486 | } |
483 | } | 487 | } |
484 | 488 | ||
485 | #if ENABLE_FEATURE_TOPMEM | 489 | #if ENABLE_FEATURE_TOPMEM |