OSDN Git Service

2001-01-17 Jeff Johnston <jjohnstn@redhat.com>
authorjjohnstn <jjohnstn>
Wed, 17 Jan 2001 21:05:09 +0000 (21:05 +0000)
committerjjohnstn <jjohnstn>
Wed, 17 Jan 2001 21:05:09 +0000 (21:05 +0000)
        * stdio.cxx (stdioConsole::read): Change to read a reasonable size of
        data each time stdin gets polled.

sid/component/consoles/ChangeLog
sid/component/consoles/stdio.cxx

index 91312fe..db21bb2 100644 (file)
@@ -1,3 +1,8 @@
+2001-01-17  Jeff Johnston  <jjohnstn@redhat.com>
+
+        * stdio.cxx (stdioConsole::read): Change to read a reasonable size of
+       data each time stdin gets polled.
+
 2000-11-16  matthew green  <mrg@redhat.com>
 
        * Makefile.am: Use $(socket_libs) to add -lnsl -lsocket if needed.
index 12a8bf1..a6f28a6 100644 (file)
@@ -32,17 +32,20 @@ stdioConsole::write(host_int_4 value)
 void
 stdioConsole::read(host_int_4)
 {
-  unsigned char c;
+  unsigned char buf[1000];
+  int len;
   host_int_4 value;
 
   // Switch to non-blocking input.
   long flags = fcntl(0, F_GETFL);
   fcntl(0, F_SETFL, flags | O_NONBLOCK);
 
-  if (::read(0, &c, 1) > 0)
+  if ((len = ::read(0, buf, 1000)) > 0)
     {
-      value = c;
-      stdin_pin.drive(value);
+      for (int i = 0; i < len; ++i)
+       {
+         stdin_pin.drive(buf[i]);
+       }
     }
 
   // Restore flags.