mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 19:02:59 +00:00
check for errors in all pollfd structs from qt_safe_poll()
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
468c246c4a
commit
ac9859be7c
1 changed files with 5 additions and 3 deletions
|
@ -262,9 +262,11 @@ static inline int qt_safe_poll(struct pollfd *fds, nfds_t nfds, int timeout)
|
|||
{
|
||||
int ret;
|
||||
Q_EINTR_LOOP(ret, ::poll(fds, nfds, timeout));
|
||||
if ((fds->revents & POLLERR) != 0 || (fds->revents & POLLHUP) != 0 || (fds->revents & POLLNVAL) != 0) {
|
||||
// select() compat
|
||||
return -1;
|
||||
for (nfds_t i = 0; i < nfds; i++) {
|
||||
if ((fds[i].revents & POLLERR) != 0 || (fds[i].revents & POLLHUP) != 0 || (fds[i].revents & POLLNVAL) != 0) {
|
||||
// select() compat
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue