diff options
Diffstat (limited to 'libbb')
-rw-r--r-- | libbb/procps.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libbb/procps.c b/libbb/procps.c index 879cc105a..e04ff34ff 100644 --- a/libbb/procps.c +++ b/libbb/procps.c | |||
@@ -243,10 +243,12 @@ procps_status_t* procps_scan(procps_status_t* sp, int flags) | |||
243 | sp->tty_str[0] = '?'; | 243 | sp->tty_str[0] = '?'; |
244 | /* sp->tty_str[1] = '\0'; - done by memset */ | 244 | /* sp->tty_str[1] = '\0'; - done by memset */ |
245 | tty = fast_strtoul_10(cp, &cp); | 245 | tty = fast_strtoul_10(cp, &cp); |
246 | if (tty) /* tty field of "0" means "no tty" */ | 246 | if (tty && (flags & PSSCAN_TTY)) { |
247 | /* tty field of "0" means "no tty" */ | ||
247 | snprintf(sp->tty_str, sizeof(sp->tty_str), "%u,%u", | 248 | snprintf(sp->tty_str, sizeof(sp->tty_str), "%u,%u", |
248 | (tty >> 8) & 0xfff, /* major */ | 249 | (tty >> 8) & 0xfff, /* major */ |
249 | (tty & 0xff) | ((tty >> 12) & 0xfff00)); | 250 | (tty & 0xff) | ((tty >> 12) & 0xfff00)); |
251 | } | ||
250 | cp = skip_fields(cp, 6); /* tpgid, flags, min_flt, cmin_flt, maj_flt, cmaj_flt */ | 252 | cp = skip_fields(cp, 6); /* tpgid, flags, min_flt, cmin_flt, maj_flt, cmaj_flt */ |
251 | sp->utime = fast_strtoul_10(cp, &cp); | 253 | sp->utime = fast_strtoul_10(cp, &cp); |
252 | sp->stime = fast_strtoul_10(cp, &cp); | 254 | sp->stime = fast_strtoul_10(cp, &cp); |