diff options
-rw-r--r-- | src/virt-viewer-events.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/virt-viewer-events.c b/src/virt-viewer-events.c index f68791f..fe3aaa6 100644 --- a/src/virt-viewer-events.c +++ b/src/virt-viewer-events.c @@ -113,10 +113,12 @@ int virt_viewer_events_add_handle(int fd, g_debug("Add handle %d %d %p", data->fd, events, data->opaque); - data->source = g_io_add_watch(data->channel, - cond, - virt_viewer_events_dispatch_handle, - data); + if (events != 0) { + data->source = g_io_add_watch(data->channel, + cond, + virt_viewer_events_dispatch_handle, + data); + } g_ptr_array_add(handles, data); |