ls,ps,watch: measure terminal width on fd 0, not 1

This commit is contained in:
Denis Vlasenko
2007-08-09 08:27:24 +00:00
parent 501bfe2630
commit f893da875a
5 changed files with 9 additions and 7 deletions

View File

@@ -612,7 +612,7 @@ void selinux_or_die(void)
/* It is perfectly ok to pass in a NULL for either width or for
* height, in which case that value will not be set. */
int get_terminal_width_height(const int fd, int *width, int *height)
int get_terminal_width_height(int fd, int *width, int *height)
{
struct winsize win = { 0, 0, 0, 0 };
int ret = ioctl(fd, TIOCGWINSZ, &win);