aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2009-06-25 14:14:10 -0400
committerDan Williams <dcbw@redhat.com>2009-06-25 14:14:10 -0400
commitbb50295e5efabf3f8dcbee1102bf3856343f04d9 (patch)
tree528ce74ca478996d323261e63666f52ca44aeae5 /src
parent742bf7d17cef714a7fa456061b80e239761c4fed (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/mm-serial-port.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mm-serial-port.c b/src/mm-serial-port.c
index ac5d1d32..357fc947 100644
--- a/src/mm-serial-port.c
+++ b/src/mm-serial-port.c
@@ -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);