]> xenbits.xensource.com Git - people/sstabellini/xen-unstable.git/.git/commitdiff
tools/oxenstored: Fix | vs & error in fd event handling
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 26 Nov 2014 15:09:40 +0000 (15:09 +0000)
committerIan Campbell <ian.campbell@citrix.com>
Fri, 28 Nov 2014 11:09:24 +0000 (11:09 +0000)
This makes fields 0 and 1 true more often than they should be, resulting
problems when handling events.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
CC: Ian Jackson <Ian.Jackson@eu.citrix.com>
CC: Wei Liu <wei.liu2@citrix.com>
CC: Dave Scott <Dave.Scott@eu.citrix.com>
CC: Zheng Li <zheng.li3@citrix.com>
CC: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Zheng Li <dev@zheng.li>
Reviewed-by: David Scott <dave.scott@citrix.com>
tools/ocaml/xenstored/select_stubs.c

index 4a8edb55480d1cac5e4f3051435f90791aecdd3b..af72b84fa2845f57c208861176505ddbb418817e 100644 (file)
@@ -56,8 +56,8 @@ CAMLprim value stub_select_on_poll(value fd_events, value timeo) {
                        events = Field(Field(fd_events, i), 1);
 
                        if (c_fds[i].revents & POLLNVAL) unix_error(EBADF, "select", Nothing);
-                       Field(events, 0) = Val_bool(c_fds[i].events | POLLIN  && c_fds[i].revents & (POLLIN |POLLHUP|POLLERR));
-                       Field(events, 1) = Val_bool(c_fds[i].events | POLLOUT && c_fds[i].revents & (POLLOUT|POLLHUP|POLLERR));
+                       Field(events, 0) = Val_bool(c_fds[i].events & POLLIN  && c_fds[i].revents & (POLLIN |POLLHUP|POLLERR));
+                       Field(events, 1) = Val_bool(c_fds[i].events & POLLOUT && c_fds[i].revents & (POLLOUT|POLLHUP|POLLERR));
                        Field(events, 2) = Val_bool(c_fds[i].revents & POLLPRI);
 
                }