Close the serial device on HUP.

This commit is contained in:
Tambet Ingo
2009-02-13 10:54:21 +02:00
parent 28fd7f7820
commit 13facad4fa

View File

@@ -476,7 +476,13 @@ data_available (GIOChannel *source,
gsize bytes_read;
GIOStatus status;
if (condition & G_IO_HUP || condition & G_IO_ERR) {
if (condition & G_IO_HUP) {
g_string_truncate (priv->response, 0);
mm_serial_close (self);
return FALSE;
}
if (condition & G_IO_ERR) {
g_string_truncate (priv->response, 0);
return TRUE;
}