diff options
author | Christophe Fergeau <cfergeau@redhat.com> | 2016-12-19 17:28:41 +0100 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2016-12-19 17:28:41 +0100 |
commit | a283cda0c4dbacb1d4b398b45f271275a3d1121a (patch) | |
tree | 8a7f5acd73464db5498f7fbeff48cee464c68d1e | |
parent | bfb724076d575d5a49d08913b86885688251a176 (diff) |
Revert "Remove unused 'event_mask' field"
This reverts commit bfb724076d575d5a49d08913b86885688251a176.
This was pushed by mistake.
-rw-r--r-- | src/spiceqxl_main_loop.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/spiceqxl_main_loop.c b/src/spiceqxl_main_loop.c index 86dcad3..0213693 100644 --- a/src/spiceqxl_main_loop.c +++ b/src/spiceqxl_main_loop.c @@ -338,6 +338,7 @@ static void xspice_wakeup_handler(pointer data, int nfds, pointer readmask) struct SpiceWatch { int fd; + int event_mask; SpiceWatchFunc func; void *opaque; }; @@ -346,11 +347,11 @@ static void watch_fd_notified(int fd, int xevents, void *data) { SpiceWatch *watch = (SpiceWatch *)data; - if (xevents & X_NOTIFY_READ) { + if ((watch->event_mask & SPICE_WATCH_EVENT_READ) && (xevents & X_NOTIFY_READ)) { watch->func(watch->fd, SPICE_WATCH_EVENT_READ, watch->opaque); } - if (xevents & X_NOTIFY_WRITE) { + if ((watch->event_mask & SPICE_WATCH_EVENT_WRITE) && (xevents & X_NOTIFY_WRITE)) { watch->func(watch->fd, SPICE_WATCH_EVENT_WRITE, watch->opaque); } } @@ -360,6 +361,7 @@ static int watch_update_mask_internal(SpiceWatch *watch, int event_mask) int x_event_mask = 0; SetNotifyFd(watch->fd, NULL, X_NOTIFY_NONE, NULL); + watch->event_mask = 0; if (event_mask & SPICE_WATCH_EVENT_READ) { x_event_mask |= X_NOTIFY_READ; @@ -372,6 +374,7 @@ static int watch_update_mask_internal(SpiceWatch *watch, int event_mask) return -1; } SetNotifyFd(watch->fd, watch_fd_notified, x_event_mask, watch); + watch->event_mask = event_mask; return 0; } |