diff src/event/modules/ngx_epoll_module.c @ 652:d9136cb50cd3 NGINX_1_1_10

nginx 1.1.10 *) Bugfix: a segmentation fault occured in a worker process if AIO was used on Linux; the bug had appeared in 1.1.9.
author Igor Sysoev <http://sysoev.ru>
date Wed, 30 Nov 2011 00:00:00 +0400
parents 4d05413aebad
children d0f7a625f27c
line wrap: on
line diff
--- a/src/event/modules/ngx_epoll_module.c
+++ b/src/event/modules/ngx_epoll_module.c
@@ -681,19 +681,19 @@ ngx_epoll_process_events(ngx_cycle_t *cy
 
         wev = c->write;
 
-        if (c->fd == -1 || wev->instance != instance) {
+        if ((revents & EPOLLOUT) && wev->active) {
 
-            /*
-             * the stale event from a file descriptor
-             * that was just closed in this iteration
-             */
+            if (c->fd == -1 || wev->instance != instance) {
 
-            ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
-                           "epoll: stale event %p", c);
-            continue;
-        }
+                /*
+                 * the stale event from a file descriptor
+                 * that was just closed in this iteration
+                 */
 
-        if ((revents & EPOLLOUT) && wev->active) {
+                ngx_log_debug1(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
+                               "epoll: stale event %p", c);
+                continue;
+            }
 
             if (flags & NGX_POST_THREAD_EVENTS) {
                 wev->posted_ready = 1;