mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-25 03:12:56 +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,10 +262,12 @@ static inline int qt_safe_poll(struct pollfd *fds, nfds_t nfds, int timeout)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
Q_EINTR_LOOP(ret, ::poll(fds, nfds, timeout));
|
Q_EINTR_LOOP(ret, ::poll(fds, nfds, timeout));
|
||||||
if ((fds->revents & POLLERR) != 0 || (fds->revents & POLLHUP) != 0 || (fds->revents & POLLNVAL) != 0) {
|
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
|
// select() compat
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue