Re: Linux 2.6.7 (stty rows 50 columns 140 reports : No such deviceor address)

From: Egmont Koblinger
Date: Wed Jun 16 2004 - 16:19:13 EST


On Wed, 16 Jun 2004 jsimmons@xxxxxxxxxxxxxxxxxxxxxxxx wrote:

Hi,

> +#ifdef TIOCGWINSZ
> + int size_was_set = 0;
> + int cols, rows;
^^^^^^^^^^^^^^^
These should both be initialized to -1 because...

> - set_window_size ((int) integer_arg (argv[k]), -1,
> - fd, device_name);
> + rows = integer_arg (argv[k]);
> + size_was_set = 1;

[...]

> - set_window_size (-1, (int) integer_arg (argv[k]),
> - fd, device_name);
> + cols = integer_arg (argv[k]);
> + size_was_set = 1;

...here maybe only one of them is set, but...

> + if (size_was_set)
> + {
> + set_window_size (rows, cols, fd, device_name);

...here both of them are used. Looking at the body of size_was_set()
and the code that was removed from stty it's clear that -1 means don't
change, while 0 means change to 0.



--
Egmont
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/