OSDN Git Service
(root)
/
kde
/
Katie.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
468c246
)
check for errors in all pollfd structs from qt_safe_poll()
author
Ivailo Monev
<xakepa10@gmail.com>
Fri, 24 Sep 2021 13:41:23 +0000
(16:41 +0300)
committer
Ivailo Monev
<xakepa10@gmail.com>
Fri, 24 Sep 2021 13:41:23 +0000
(16:41 +0300)
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
src/core/kernel/qcore_unix_p.h
patch
|
blob
|
history
diff --git
a/src/core/kernel/qcore_unix_p.h
b/src/core/kernel/qcore_unix_p.h
index
ee67948
..
453fcd9
100644
(file)
--- a/
src/core/kernel/qcore_unix_p.h
+++ b/
src/core/kernel/qcore_unix_p.h
@@
-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;
}