port-serial: always set the forced_close flag if forced to close

This commit is contained in:
Aleksander Morgado
2013-11-20 18:24:38 +01:00
parent 0d0f5de161
commit b28230411a

View File

@@ -1245,6 +1245,10 @@ port_serial_close_force (MMPortSerial *self)
mm_dbg ("(%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 */
self->priv->forced_close = TRUE;
/* If already closed, done */
if (!self->priv->open_count && !self->priv->reopen_ctx)
return;
@@ -1256,10 +1260,6 @@ port_serial_close_force (MMPortSerial *self)
self->priv->open_count = 1;
mm_port_serial_close (self);
/* Mark as having forced the close, so that we don't warn about incorrect
* open counts */
self->priv->forced_close = TRUE;
/* Notify about the forced close status */
g_signal_emit (self, signals[FORCED_CLOSE], 0);
}