port-serial: always set the forced_close flag if forced to close
This commit is contained in:
@@ -1245,6 +1245,10 @@ port_serial_close_force (MMPortSerial *self)
|
|||||||
|
|
||||||
mm_dbg ("(%s) forced to close port", mm_port_get_device (MM_PORT (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 already closed, done */
|
||||||
if (!self->priv->open_count && !self->priv->reopen_ctx)
|
if (!self->priv->open_count && !self->priv->reopen_ctx)
|
||||||
return;
|
return;
|
||||||
@@ -1256,10 +1260,6 @@ port_serial_close_force (MMPortSerial *self)
|
|||||||
self->priv->open_count = 1;
|
self->priv->open_count = 1;
|
||||||
mm_port_serial_close (self);
|
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 */
|
/* Notify about the forced close status */
|
||||||
g_signal_emit (self, signals[FORCED_CLOSE], 0);
|
g_signal_emit (self, signals[FORCED_CLOSE], 0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user