diff options
author | Dan Williams <dcbw@redhat.com> | 2010-03-17 12:05:31 -0700 |
---|---|---|
committer | Dan Williams <dcbw@redhat.com> | 2010-03-17 12:05:31 -0700 |
commit | fb2b80f11a081128ecf966eae5454534fbacc89c (patch) | |
tree | 0774469d7c92c1a69ce99f13a4c06ab66ae24172 /src/mm-serial-port.c | |
parent | 857dcd7bcfd909a9c4dad8dcbe562e75c8a66116 (diff) |
serial: flush I/O right after open
We don't really care about anything that came before.
Diffstat (limited to 'src/mm-serial-port.c')
-rw-r--r-- | src/mm-serial-port.c | 3 |
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)); |