From bb50295e5efabf3f8dcbee1102bf3856343f04d9 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Thu, 25 Jun 2009 14:14:10 -0400 Subject: 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. --- src/mm-serial-port.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') 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); -- cgit v1.2.3-70-g09d2