lkml.org 
[lkml]   [2004]   [Jun]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Linux 2.6.7 (stty rows 50 columns 140 reports : No such device or address)
On Wed, 16 Jun 2004 jsimmons@pentafluge.infradead.org 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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:03    [W:1.041 / U:0.120 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site