diff src/os/unix/ngx_channel.c @ 391:b670db10cbbd

nginx-0.0.7-2004-07-14-20:01:42 import
author Igor Sysoev <igor@sysoev.ru>
date Wed, 14 Jul 2004 16:01:42 +0000
parents 02a511569afb
children da8c5707af39
line wrap: on
line diff
--- a/src/os/unix/ngx_channel.c
+++ b/src/os/unix/ngx_channel.c
@@ -205,7 +205,7 @@ ngx_int_t ngx_add_channel_event(ngx_cycl
 
     ev->event_handler = handler;
 
-    if (ngx_add_conn) {
+    if (ngx_add_conn && (ngx_event_flags & NGX_USE_EPOLL_EVENT) == 0) {
         if (ngx_add_conn(c) == NGX_ERROR) {
             return NGX_ERROR;
         }
@@ -218,3 +218,15 @@ ngx_int_t ngx_add_channel_event(ngx_cycl
 
     return NGX_OK;
 }
+
+
+void ngx_close_channel(ngx_fd_t *fd, ngx_log_t *log)
+{
+    if (close(fd[0]) == -1) {
+        ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "close() failed");
+    }
+
+    if (close(fd[1]) == -1) {
+        ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, "close() failed");
+    }
+}