serial-port: if 0 bytes are read, just return
Otherwise, if something else is mistakenly holding the serial port open at the same time as this MMSerialPort, you get a stream of reads of size 0 and effectively hang modem-manager.
This commit is contained in:
@@ -620,6 +620,10 @@ data_available (GIOChannel *source,
|
||||
err = NULL;
|
||||
}
|
||||
|
||||
/* If no bytes read, just let g_io_channel wait for more data */
|
||||
if (bytes_read == 0)
|
||||
break;
|
||||
|
||||
if (bytes_read > 0) {
|
||||
serial_debug (self, "<--", buf, bytes_read);
|
||||
g_string_append_len (priv->response, buf, bytes_read);
|
||||
|
||||
Reference in New Issue
Block a user