* lin-lwp.c (stop_wait_callback): Remove bogus assertions in the
[deliverable/binutils-gdb.git] / gdb / ser-unix.c
index 80e550d0587b95daad1b8b927db10c85c2cd93ee..73555b27a0a6e0fe7b1651f423be5753d2c55604 100644 (file)
@@ -25,9 +25,7 @@
 #include <fcntl.h>
 #include <sys/types.h>
 #include "terminal.h"
-#ifdef HAVE_SYS_WAIT_H
-#include <sys/wait.h>
-#endif
+#include "gdb_wait.h"
 #include <sys/socket.h>
 #include <sys/time.h>
 
@@ -780,9 +778,7 @@ hardwire_setbaudrate (serial_t scb, int rate)
 }
 
 static int
-hardwire_setstopbits (scb, num)
-     serial_t scb;
-     int num;
+hardwire_setstopbits (serial_t scb, int num)
 {
   struct hardwire_ttystate state;
   int newbit;
@@ -931,7 +927,7 @@ do_unix_readchar (serial_t scb, int timeout)
        }
 
       status = ser_unix_wait_for (scb, delta);
-      timeout -= delta;
+      timeout = (timeout <= 0) ? timeout : (timeout - delta);
 
       /* If we got a character or an error back from wait_for, then we can 
          break from the loop before the timeout is completed. */
This page took 0.023339 seconds and 4 git commands to generate.