select_info had the wrong size (uint8 instead of uint16).
Corrected POLLNVAL handling. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@1750 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
b9db114e51
commit
4a2e58074d
@ -2708,6 +2708,8 @@ common_poll(struct pollfd *fds, nfds_t numfds, bigtime_t timeout, bool kernel)
|
||||
fds[i].revents = POLLNVAL;
|
||||
continue;
|
||||
}
|
||||
// clear reported events mask
|
||||
fds[i].revents = 0;
|
||||
|
||||
if ((fds[i].events & POLLIN)
|
||||
&& select_fd(fd, B_SELECT_READ, MAKE_SELECT_REF(fd, B_SELECT_READ), &sync, kernel) == B_OK)
|
||||
@ -2774,6 +2776,9 @@ common_poll(struct pollfd *fds, nfds_t numfds, bigtime_t timeout, bool kernel)
|
||||
switch (status) {
|
||||
case B_OK:
|
||||
for (count = 0, i = 0;i < numfds; i++) {
|
||||
if (fds[i].revents == POLLNVAL)
|
||||
continue;
|
||||
|
||||
// POLLxxx flags and B_SELECT_xxx flags are compatible
|
||||
fds[i].revents = sync.set[i].events;
|
||||
if (fds[i].revents != 0)
|
||||
|
@ -6,7 +6,7 @@
|
||||
#define VFS_SELECT_H
|
||||
|
||||
typedef struct select_info {
|
||||
uint8 events;
|
||||
uint16 events;
|
||||
} select_info;
|
||||
|
||||
typedef struct select_sync {
|
||||
|
Loading…
Reference in New Issue
Block a user