lkml.org 
[lkml]   [2004]   [Jun]   [16]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateWed, 16 Jun 2004 17:37:42 +0100 (BST)
From jsimmons@pentaflu ...
SubjectRe: Linux 2.6.7 (stty rows 50 columns 140 reports : No such device or address)
Actually its a bug in stty itself. stty only sets the row or column at a 
time. So when you do a stty row col it is actually doing TWO mode sets.
One to change the number of rows then another to change the number of 
columns. So to the fbdev driver it looks like this:

640x480 -> 1024x480 -> 1024x768

Now for alot of driver the middle setting doesn't work. So it fails. 
This bug also effects serial consoles as well. I CC the stty maintain so 
he can apply the below patch. It is against the latest GNU core utilites.
It fixes the issue.

--- stty.c.orig	2004-05-07 17:48:51.000000000 -0700
+++ stty.c	2004-05-07 18:00:36.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, rows;
+#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@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    [from the cache]
©2003-2008