/* Serial interface for local (hardwired) serial ports on Un*x like systems
- Copyright 1992, 1993, 1994, 1998-1999 Free Software Foundation, Inc.
+ Copyright 1992-1994, 1998-2000 Free Software Foundation, Inc.
This file is part of GDB.
#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_set_tty_state (serial_t scb, serial_ttystate state);
static int hardwire_noflush_set_tty_state (serial_t, serial_ttystate,
serial_ttystate);
-static void hardwire_print_tty_state (serial_t, serial_ttystate, struct gdb_file *);
+static void hardwire_print_tty_state (serial_t, serial_ttystate, struct ui_file *);
static int hardwire_drain_output (serial_t);
static int hardwire_flush_output (serial_t);
static int hardwire_flush_input (serial_t);
static void
hardwire_print_tty_state (serial_t scb,
serial_ttystate ttystate,
- struct gdb_file *stream)
+ struct ui_file *stream)
{
struct hardwire_ttystate *state = (struct hardwire_ttystate *) ttystate;
int i;
}
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;
+ if (timeout > 0)
+ 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. */
void
ser_unix_nop_print_tty_state (serial_t scb,
serial_ttystate ttystate,
- struct gdb_file *stream)
+ struct ui_file *stream)
{
/* Nothing to print. */
return;
if (SERIAL_DEBUG_P (scb))
fprintf_unfiltered (gdb_stdlog, "[fd%d->synchronous]\n",
scb->fd);
- /* De-schedule what ever tasks are currently scheduled. */
+ /* De-schedule whatever tasks are currently scheduled. */
switch (scb->async_state)
{
case FD_SCHEDULED: