aboutsummaryrefslogtreecommitdiff
path: root/gdb/ser-unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/ser-unix.c')
-rw-r--r--gdb/ser-unix.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/gdb/ser-unix.c b/gdb/ser-unix.c
index 093143c..a4a00e5 100644
--- a/gdb/ser-unix.c
+++ b/gdb/ser-unix.c
@@ -21,14 +21,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
#include "serial.h"
#include <fcntl.h>
#include <sys/types.h>
-
-#if !defined (HAVE_TERMIOS) && !defined (HAVE_TERMIO) && !defined (HAVE_SGTTY)
-#define HAVE_SGTTY
+#include "terminal.h"
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
#endif
#ifdef HAVE_TERMIOS
-#include <termios.h>
-#include <unistd.h>
struct hardwire_ttystate
{
@@ -37,7 +35,6 @@ struct hardwire_ttystate
#endif /* termios */
#ifdef HAVE_TERMIO
-#include <termio.h>
/* It is believed that all systems which have added job control to SVR3
(e.g. sco) have also added termios. Even if not, trying to figure out
@@ -55,8 +52,6 @@ struct hardwire_ttystate
too if it existed on all systems. */
#include <sys/time.h>
-#include <sgtty.h>
-
struct hardwire_ttystate
{
struct sgttyb sgttyb;
@@ -296,6 +291,9 @@ static int
hardwire_flush_input (scb)
serial_t scb;
{
+ scb->bufcnt = 0;
+ scb->bufp = scb->buf;
+
#ifdef HAVE_TERMIOS
return tcflush (scb->fd, TCIFLUSH);
#endif