#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>
}
static int
-hardwire_setstopbits (scb, num)
- serial_t scb;
- int num;
+hardwire_setstopbits (serial_t scb, int num)
{
struct hardwire_ttystate state;
int newbit;
}
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. */