* remote-hms.c, ser-go32.c, serial.h: Change from
authorStu Grossman <grossman@cygnus>
Mon, 19 Oct 1992 23:40:36 +0000 (23:40 +0000)
committerStu Grossman <grossman@cygnus>
Mon, 19 Oct 1992 23:40:36 +0000 (23:40 +0000)
serial_timedreadchar() to new serial_readchar().

gdb/ChangeLog
gdb/remote-hms.c
gdb/ser-go32.c
gdb/serial.h

index 21ccf6d322788dff4b438c94c40c4e8f2df357b4..6c160e6f57fdfd47cfd216acff720245d287935f 100644 (file)
@@ -1,5 +1,8 @@
 Mon Oct 19 15:09:57 1992  Stu Grossman  (grossman at cygnus.com)
 
+       * remote-hms.c, ser-go32.c, serial.h:  Change from
+       serial_timedreadchar() to new serial_readchar().
+
        * Makefile.in (HFILES):  Fixup list of nm-*.h files.  Add missing ones.
 
 Mon Oct 19 12:45:23 1992  Per Bothner  (bothner@cygnus.com)
index e5f1f028c779c09fd6bd7bab66c1c3ae8bb7d059..cbe4748943c547b6e2a474dd34a542e240ad310a 100644 (file)
@@ -251,11 +251,10 @@ int check_open()
 static int
 readchar ()
 {
-  int ok;
   int buf;
-  buf = serial_timedreadchar(timeout, &ok);
+  buf = serial_readchar(timeout);
 
-  if (!ok)
+  if (buf < 0)
    error ("Timeout reading from remote system.");
 
   if (!quiet)
@@ -267,10 +266,9 @@ readchar ()
 static int
 readchar_nofail ()
 {
-  int ok;
   int buf;
-  buf = serial_timedreadchar(timeout, &ok);
-  if (!ok) buf = 0;
+  buf = serial_readchar(timeout);
+  if (buf < 0) buf = 0;
   if (!quiet)
    printf("%c",buf);
   
@@ -544,8 +542,8 @@ is_baudrate_right()
   
   while (1) 
   {
-    serial_timedreadchar(timeout, &ok);
-    if (!ok) break;
+    ok = serial_readchar(timeout);
+    if (ok < 0) break;
   }
 
   hms_write("r",1);
index 3e446aa4f889c84b3e56ad244b876de1768772ed..f729d722a50326b0bdd835ceb17ae94c0c008edb 100644 (file)
@@ -294,20 +294,14 @@ serial_open (name)
 }
 
 int
-serial_timedreadchar (to, ok)
+serial_readchar (to)
       int to;
-      int *ok;
 {
   char buf;
   if (dosasync_read(fd, &buf, 1, to))  
-  {
-    *ok = 1;
-  }
+    return buf;
   else
-  {
-    *ok = 0;
-  }
-  return buf;
+    return -2; /* Timeout, I guess */
 }
 
 int
index 796f2d2b8c5f0179698b76629a62c863454b84e1..5363929b0220a0c30173f1b5bd2bdcefc65f2ec6 100644 (file)
@@ -56,9 +56,9 @@ void serial_raw PARAMS ((int fd, struct ttystate *oldstate));
 void serial_normal PARAMS ((void));
 
 /* Read one char from the serial device with <TO>-second timeout.
-   Return char, and set ok if ok.  */
+   Returns char if ok, else EOF, -2 for timeout, -3 for anything else  */
 
-int serial_timedreadchar PARAMS ((int to, int *ok));
+int serial_readchar PARAMS ((int to));
 
 /* Set the baudrate to the decimal value supplied, and return 1, or fail and
    return 0.  */
This page took 0.028066 seconds and 4 git commands to generate.