[BusyBox] multiple cin patch
Erik Andersen
andersen at lineo.com
Fri Jan 26 18:23:34 UTC 2001
On Fri Jan 26, 2001 at 12:31:38PM +0300, Vladimir N. Oleynik wrote:
>
> > #ifdef BB_FEATURE_USE_TERMIOS
> > - cin = fopen("/dev/tty", "r");
> > - if (!cin)
> > - cin = fopen("/dev/console", "r");
> > - getTermSettings(fileno(cin), &initial_settings);
> > + morecin = fopen("/dev/tty", "r");
> > + if (!morecin)
> > + morecin = fopen("/dev/console", "r");
> > + getTermSettings(fileno(morecin), &initial_settings);
> > - setTermSettings(fileno(cin), &new_settings);
> > + setTermSettings(fileno(morecin), &new_settings);
>
Yes, I agree -- my patch was stupid. It is better to just do
#ifdef BB_FEATURE_AUTOWIDTH
ioctl(fileno(stdout), TIOCGWINSZ, &win);
if (win.ws_row > 4)
column_width = win.ws_row - 2;
if (win.ws_col > 0)
terminal_width = win.ws_col - 1;
#endif
ls is not making any interactive termios calls, so there
is no need for the signal handler or setTermSettings.
I have now fixed this so it is much simpler,
-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