diff options
| author | Igor Sysoev <igor@sysoev.ru> | 2004-07-07 15:01:00 +0000 |
|---|---|---|
| committer | Igor Sysoev <igor@sysoev.ru> | 2004-07-07 15:01:00 +0000 |
| commit | 2b97993c7a6525bf41c694414450943d39605757 (patch) | |
| tree | b3b3870575cd65e64ef59de5359bfdd3695bc77c /src/event/modules/ngx_poll_module.c | |
| parent | c78c41cefcf1e1fa8005f81b7c6cc0c857bcf46f (diff) | |
| download | nginx-2b97993c7a6525bf41c694414450943d39605757.tar.gz nginx-2b97993c7a6525bf41c694414450943d39605757.tar.bz2 | |
nginx-0.0.7-2004-07-07-19:01:00 import
Diffstat (limited to 'src/event/modules/ngx_poll_module.c')
| -rw-r--r-- | src/event/modules/ngx_poll_module.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/event/modules/ngx_poll_module.c b/src/event/modules/ngx_poll_module.c index 2170d0e02..75172f1d7 100644 --- a/src/event/modules/ngx_poll_module.c +++ b/src/event/modules/ngx_poll_module.c @@ -14,6 +14,7 @@ static void ngx_poll_done(ngx_cycle_t *cycle); static ngx_int_t ngx_poll_add_event(ngx_event_t *ev, int event, u_int flags); static ngx_int_t ngx_poll_del_event(ngx_event_t *ev, int event, u_int flags); static ngx_int_t ngx_poll_process_events(ngx_cycle_t *cycle); +static char *ngx_poll_init_conf(ngx_cycle_t *cycle, void *conf); static struct pollfd *event_list; @@ -31,7 +32,7 @@ static ngx_str_t poll_name = ngx_string("poll"); ngx_event_module_t ngx_poll_module_ctx = { &poll_name, NULL, /* create configuration */ - NULL, /* init configuration */ + ngx_poll_init_conf, /* init configuration */ { ngx_poll_add_event, /* add an event */ @@ -577,3 +578,27 @@ static ngx_int_t ngx_poll_process_events(ngx_cycle_t *cycle) return nready; } + + +static char *ngx_poll_init_conf(ngx_cycle_t *cycle, void *conf) +{ + ngx_event_conf_t *ecf; + + ecf = ngx_event_get_conf(cycle->conf_ctx, ngx_event_core_module); + + if (ecf->use != ngx_poll_module.ctx_index) { + return NGX_CONF_OK; + } + +#if (NGX_THREADS) + + ngx_log_error(NGX_LOG_EMERG, cycle->log, 0, + "poll() is not supported in the threaded mode"); + return NGX_CONF_ERROR; + +#else + + return NGX_CONF_OK; + +#endif +} |
