serial: mark port disconnected on close

Otherwise it could still be connected when the port was opened again,
and subsequent calls for stuff could fail.
This commit is contained in:
Dan Williams
2009-09-08 17:41:25 -07:00
parent 14e5c52f78
commit c02adee802

View File

@@ -812,6 +812,8 @@ mm_serial_port_close (MMSerialPort *self)
if (priv->fd >= 0) {
g_message ("(%s) closing serial device...", mm_port_get_device (MM_PORT (self)));
mm_port_set_connected (MM_PORT (self), FALSE);
if (priv->channel) {
g_source_remove (priv->watch_id);
g_io_channel_shutdown (priv->channel, TRUE, NULL);