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

From: jsimmons
Date: Wed Jun 16 2004 - 16:52:12 EST



Ug. Missed that. I don't know how but my system always worked.
Here is the new patch.

--- stty.c.orig 2004-05-07 17:48:51.000000000 -0700
+++ stty.c 2004-06-16 14:38:21.000000000 -0700
@@ -733,6 +733,10 @@
int speed_was_set;
int verbose_output;
int recoverable_output;
+#ifdef TIOCGWINSZ
+ int size_was_set = 0;
+ int cols = -1, rows = -1;
+#endif
int k;
int noargs = 1;
char *file_name = NULL;
@@ -1004,8 +1008,8 @@
usage (EXIT_FAILURE);
}
++k;
- set_window_size ((int) integer_arg (argv[k]), -1,
- fd, device_name);
+ rows = integer_arg (argv[k]);
+ size_was_set = 1;
}
else if (STREQ (argv[k], "cols")
|| STREQ (argv[k], "columns"))
@@ -1016,8 +1020,8 @@
usage (EXIT_FAILURE);
}
++k;
- set_window_size (-1, (int) integer_arg (argv[k]),
- fd, device_name);
+ cols = integer_arg (argv[k]);
+ size_was_set = 1;
}
else if (STREQ (argv[k], "size"))
{
@@ -1063,6 +1067,12 @@
k++;
}

+#ifdef TIOCGWINSZ
+ if (size_was_set)
+ {
+ set_window_size (rows, cols, fd, device_name);
+ }
+#endif
if (require_set_attr)
{
struct termios new_mode;
-
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/