serial-port: ensure we close the port when forcing to close it

This commit is contained in:
Aleksander Morgado
2012-03-28 15:50:43 +02:00
parent b8157228eb
commit 62923f9086
+4 -4
View File
@@ -1069,10 +1069,6 @@ mm_serial_port_close_force (MMSerialPort *self)
mm_info ("(%s) forced to close port",
mm_port_get_device (MM_PORT (self)));
/* Mark as having forced the close, so that we don't warn about incorrect
* open counts */
priv->forced_close = TRUE;
/* If already closed, done */
if (!priv->open_count)
return;
@@ -1080,6 +1076,10 @@ mm_serial_port_close_force (MMSerialPort *self)
/* Force the port to close */
priv->open_count = 1;
mm_serial_port_close (self);
/* Mark as having forced the close, so that we don't warn about incorrect
* open counts */
priv->forced_close = TRUE;
}
static void