svn commit: trunk/busybox/libbb

vda at busybox.net vda at busybox.net
Tue Jun 19 13:53:13 UTC 2007


Author: vda
Date: 2007-06-19 06:53:12 -0700 (Tue, 19 Jun 2007)
New Revision: 18854

Log:
top: speedup if tty info is not requested



Modified:
   trunk/busybox/libbb/procps.c


Changeset:
Modified: trunk/busybox/libbb/procps.c
===================================================================
--- trunk/busybox/libbb/procps.c	2007-06-19 13:46:24 UTC (rev 18853)
+++ trunk/busybox/libbb/procps.c	2007-06-19 13:53:12 UTC (rev 18854)
@@ -243,10 +243,12 @@
 			sp->tty_str[0] = '?';
 			/* sp->tty_str[1] = '\0'; - done by memset */
 			tty = fast_strtoul_10(cp, &cp);
-			if (tty) /* tty field of "0" means "no tty" */
+			if (tty && (flags & PSSCAN_TTY)) {
+				/* tty field of "0" means "no tty" */
 				snprintf(sp->tty_str, sizeof(sp->tty_str), "%u,%u",
 					(tty >> 8) & 0xfff, /* major */
 					(tty & 0xff) | ((tty >> 12) & 0xfff00));
+			}
 			cp = skip_fields(cp, 6); /* tpgid, flags, min_flt, cmin_flt, maj_flt, cmaj_flt */
 			sp->utime = fast_strtoul_10(cp, &cp);
 			sp->stime = fast_strtoul_10(cp, &cp);




More information about the busybox-cvs mailing list