mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-23 20:11:49 +00:00
Fixed poll() issue with QNX
This commit is contained in:
1 parent
a881aad5c6
commit
463b49f1bd
1 file changed
+5
-1
+5
-1
@@ -5014,7 +5014,11 @@ static void *master_thread(void *thread_func_param) {
|
|||||||
|
|
||||||
if (poll(pfd, ctx->num_listening_sockets, 200) > 0) {
|
if (poll(pfd, ctx->num_listening_sockets, 200) > 0) {
|
||||||
for (i = 0; i < ctx->num_listening_sockets; i++) {
|
for (i = 0; i < ctx->num_listening_sockets; i++) {
|
||||||
if (ctx->stop_flag == 0 && pfd[i].revents == POLLIN) {
|
// NOTE(lsm): on QNX, poll() returns POLLRDNORM after the
|
||||||
|
// successfull poll, and POLLIN is defined as (POLLRDNORM | POLLRDBAND)
|
||||||
|
// Therefore, we're checking pfd[i].revents & POLLIN, not
|
||||||
|
// pfd[i].revents == POLLIN.
|
||||||
|
if (ctx->stop_flag == 0 && (pfd[i].revents & POLLIN)) {
|
||||||
accept_new_connection(&ctx->listening_sockets[i], ctx);
|
accept_new_connection(&ctx->listening_sockets[i], ctx);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user