[BusyBox] Re: Fix for "more" and "ps" on dumb terminals

Erik Andersen andersen at lineo.com
Fri Jun 2 03:10:29 UTC 2000


On Thu Jun 01, 2000 at 03:09:01PM -0400, Pavel Roskin wrote:
> Hello, Erik!
> 
> The console on Linux running on RPX/Lite (embedded PowerPC board) knows
> nothing about the screen size. This causes some problems with "more" and
> "ps" from Busybox.
> 
> ioctl(fileno(stdout), TIOCGWINSZ, &win);
> 
> doesn't fail, i.e. it returns zero. But "win" becomes {0,0}. The existing
> code takes care of this situation in the sense that is doesn't change the
> terminal size if the values in "win" are not reasonable.
[---patch snipped-----]

Agreed.  I dunno what I was thinking when I defaulted these to 0.
I changed it from 79 to use the TERMINAL_WIDTH macro instead, but
you definately get the credit for this fix.  Mea culpa.

> 
> By the way, you may want to put some common code in both versions of
> ps_main() to a separate function if you happen to hack ps.c

Yeah.  I've actually been debating removing the devps patch stuff,
since Linus has given the decree that it will never go into the kernel.
What do you think?  Should I axe it?

 -Erik

--
Erik B. Andersen   email:  andersen at lineo.com
--This message was written using 73% post-consumer electrons--





More information about the busybox mailing list