If "G_IO_IN | G_IO_ERR" occurs, function can not handle G_IO_IN.
As a result, G_IO_IN continues to trigger in the poll.
Change-Id: Iebb22830f71074aaed0fff93dab569854e4a6c71
if (h->fd != g_io_channel_unix_get_fd(source))
return TRUE;
- if (condition != G_IO_IN)
- return TRUE;
+ if (condition & (G_IO_ERR | G_IO_HUP))
+ _E("GIOChannel receives G_IO_ERR|G_IO_HUP fd = %d condition = %d", h->fd, condition);
+
+ if (!(condition & G_IO_IN) && (condition & (G_IO_ERR | G_IO_HUP))) {
+ remove_fd_read_handler((fd_handler_h *)&h);
+ return FALSE;
+ }
ret = true;
if (h->changed)
return -ENOMEM;
}
- id = g_io_add_watch(ch, G_IO_IN | G_IO_ERR,
+ id = g_io_add_watch(ch, G_IO_IN | G_IO_ERR | G_IO_HUP,
channel_changed, h);
if (id == 0) {
_E("Failed to add watch for GIOChannel");