summaryrefslogtreecommitdiff
path: root/libbb/procps.c
diff options
context:
space:
mode:
authorDenys Vlasenko2011-06-18 15:49:47 +0200
committerDenys Vlasenko2011-06-18 15:49:47 +0200
commit12ac6287eedf45d896557b95270a6e0323951917 (patch)
treede5833ccd888a768836df1353409f7b0f01501d2 /libbb/procps.c
parentda947607625bc5510ec56b27e04445db300f4418 (diff)
downloadbusybox-12ac6287eedf45d896557b95270a6e0323951917.zip
busybox-12ac6287eedf45d896557b95270a6e0323951917.tar.gz
procps: remove PSSCAN_STAT define, users were using it incorrectly
Also contains small cleanups ps. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb/procps.c')
-rw-r--r--libbb/procps.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/libbb/procps.c b/libbb/procps.c
index 5833a1f..9207e92 100644
--- a/libbb/procps.c
+++ b/libbb/procps.c
@@ -357,7 +357,14 @@ procps_status_t* FAST_FUNC procps_scan(procps_status_t* sp, int flags)
sp->gid = sb.st_gid;
}
- if (flags & PSSCAN_STAT) {
+ /* These are all retrieved from proc/NN/stat in one go: */
+ if (flags & (PSSCAN_PPID | PSSCAN_PGID | PSSCAN_SID
+ | PSSCAN_COMM | PSSCAN_STATE
+ | PSSCAN_VSZ | PSSCAN_RSS
+ | PSSCAN_STIME | PSSCAN_UTIME | PSSCAN_START_TIME
+ | PSSCAN_TTY | PSSCAN_NICE
+ | PSSCAN_CPU)
+ ) {
char *cp, *comm1;
int tty;
#if !ENABLE_FEATURE_FAST_TOP