From fb2b80f11a081128ecf966eae5454534fbacc89c Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Wed, 17 Mar 2010 12:05:31 -0700 Subject: serial: flush I/O right after open We don't really care about anything that came before. --- src/mm-serial-port.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/mm-serial-port.c') diff --git a/src/mm-serial-port.c b/src/mm-serial-port.c index 15b6a0a9..46e9c567 100644 --- a/src/mm-serial-port.c +++ b/src/mm-serial-port.c @@ -747,6 +747,9 @@ mm_serial_port_open (MMSerialPort *self, GError **error) return FALSE; } + /* Flush any waiting IO */ + tcflush (priv->fd, TCIOFLUSH); + if (tcgetattr (priv->fd, &priv->old_t) < 0) { g_set_error (error, MM_SERIAL_ERROR, MM_SERIAL_OPEN_FAILED, "Could not open serial device %s: %s", device, strerror (errno)); -- cgit v1.2.3-70-g09d2