Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2004-04-15 00:34:05 +0400
committerIgor Sysoev <igor@sysoev.ru>2004-04-15 00:34:05 +0400
commitcccc5528945be46d6afb456e7aba751340af9089 (patch)
treeb734bef5df932252d9f04ddaf39ef80c83b0b0f2 /src/core
parentb3968b314f063c42f983ba70becfb9fae97651f0 (diff)
nginx-0.0.3-2004-04-15-00:34:05 import
Diffstat (limited to 'src/core')
-rw-r--r--src/core/nginx.c7
-rw-r--r--src/core/ngx_config.h5
-rw-r--r--src/core/ngx_cycle.c11
3 files changed, 16 insertions, 7 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c
index 56a891497..a784040a7 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -277,6 +277,13 @@ static ngx_int_t ngx_getopt(ngx_master_ctx_t *ctx, ngx_cycle_t *cycle)
switch (ctx->argv[i][1]) {
case 'c':
+ if (ctx->argv[i + 1] == NULL) {
+ ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
+ "the option: \"%s\" requires file name",
+ ctx->argv[i]);
+ return NGX_ERROR;
+ }
+
cycle->conf_file.data = (u_char *) ctx->argv[++i];
cycle->conf_file.len = ngx_strlen(cycle->conf_file.data);
break;
diff --git a/src/core/ngx_config.h b/src/core/ngx_config.h
index 4e3e77bdd..dea3e5cf9 100644
--- a/src/core/ngx_config.h
+++ b/src/core/ngx_config.h
@@ -101,11 +101,6 @@ typedef int ngx_flag_t;
#define ngx_inline inline
#endif
-
-#ifndef INFTIM /* Linux */
-#define INFTIM -1
-#endif
-
#ifndef INADDR_NONE /* Solaris */
#define INADDR_NONE ((unsigned int) -1)
#endif
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c
index c04f8cf29..077b12092 100644
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -23,7 +23,7 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle)
{
void *rv;
ngx_uint_t i, n, failed;
- ngx_log_t *log;
+ ngx_log_t *log, *new_log;
ngx_conf_t conf;
ngx_pool_t *pool;
ngx_cycle_t *cycle, **old;
@@ -44,6 +44,9 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle)
}
cycle->pool = pool;
+ pool->log = log;
+ cycle->log = log;
+
cycle->old_cycle = old_cycle;
cycle->conf_file = old_cycle->conf_file;
@@ -71,7 +74,7 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle)
cycle->open_files.pool = pool;
- if (!(cycle->log = ngx_log_create_errlog(cycle, NULL))) {
+ if (!(new_log = ngx_log_create_errlog(cycle, NULL))) {
ngx_destroy_pool(pool);
return NULL;
}
@@ -129,12 +132,14 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle)
conf.module_type = NGX_CORE_MODULE;
conf.cmd_type = NGX_MAIN_CONF;
+ cycle->log = new_log;
if (ngx_conf_parse(&conf, &cycle->conf_file) != NGX_CONF_OK) {
ngx_destroy_pool(pool);
return NULL;
}
+ cycle->log = log;
for (i = 0; ngx_modules[i]; i++) {
if (ngx_modules[i]->type != NGX_CORE_MODULE) {
@@ -203,6 +208,8 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle)
}
}
+ cycle->log = new_log;
+ pool->log = new_log;
if (!failed) {
if (old_cycle->listening.nelts) {