comparison src/event/modules/ngx_epoll_module.c @ 4319:f40541f7afb5

Fixed AIO on Linux, broken in r4306. Events from eventfd do not have c->write set, and the stale event check added in r4306 causes null pointer dereference.
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 29 Nov 2011 17:27:13 +0000
parents f68047884e83
children d620f497c50f
comparison
equal deleted inserted replaced
4318:f85bd7c35c77 4319:f40541f7afb5
679 } 679 }
680 } 680 }
681 681
682 wev = c->write; 682 wev = c->write;
683 683
684 if (c->fd == -1 || wev->instance != instance) {
685
686 /*
687 * the stale event from a file descriptor
688 * that was just closed in this iteration
689 */
690
691 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
692 "epoll: stale event %p", c);
693 continue;
694 }
695
696 if ((revents & EPOLLOUT) && wev->active) { 684 if ((revents & EPOLLOUT) && wev->active) {
685
686 if (c->fd == -1 || wev->instance != instance) {
687
688 /*
689 * the stale event from a file descriptor
690 * that was just closed in this iteration
691 */
692
693 ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
694 "epoll: stale event %p", c);
695 continue;
696 }
697 697
698 if (flags & NGX_POST_THREAD_EVENTS) { 698 if (flags & NGX_POST_THREAD_EVENTS) {
699 wev->posted_ready = 1; 699 wev->posted_ready = 1;
700 700
701 } else { 701 } else {