diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-07-14 16:01:42 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-07-14 16:01:42 +0000 |
commit | 7823cc3b0d263530ed4590d27ee4d1fe12dca0dc (patch) | |
tree | deefa1b73d160085ae87c6f887298c8b95051e6b /src/os/unix/ngx_channel.c | |
parent | 846c27b2acc5f6bf942bab0d8c3b5e653b9513b4 (diff) | |
download | nginx-7823cc3b0d263530ed4590d27ee4d1fe12dca0dc.tar.gz nginx-7823cc3b0d263530ed4590d27ee4d1fe12dca0dc.zip |
nginx-0.0.7-2004-07-14-20:01:42 import
Diffstat (limited to 'src/os/unix/ngx_channel.c')
-rw-r--r-- | src/os/unix/ngx_channel.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/os/unix/ngx_channel.c b/src/os/unix/ngx_channel.c index 01416d6ab..694b1d83c 100644 --- 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_cycle_t *cycle, ngx_fd_t fd, 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_cycle_t *cycle, ngx_fd_t fd, 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"); + } +} |