aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mm-serial-port.c3
1 files changed, 3 insertions, 0 deletions
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));