diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mm-port-serial.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mm-port-serial.c b/src/mm-port-serial.c index 41a5fc27..d739313b 100644 --- a/src/mm-port-serial.c +++ b/src/mm-port-serial.c @@ -1175,6 +1175,15 @@ mm_port_serial_open (MMPortSerial *self, GError **error) return FALSE; } + if (mm_port_get_connected (MM_PORT (self))) { + g_set_error (error, + MM_SERIAL_ERROR, + MM_SERIAL_ERROR_OPEN_FAILED, + "Could not open serial device %s: port is connected", + device); + return FALSE; + } + if (self->priv->open_count) { /* Already open */ goto success; |