aboutsummaryrefslogtreecommitdiff
path: root/src/core/nginx.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2003-07-10 16:26:57 +0000
committerIgor Sysoev <igor@sysoev.ru>2003-07-10 16:26:57 +0000
commitb8c367c7b9155857f1c068624aa059830db57fa8 (patch)
treedbb12653e14051e3278b5c558de02d1917f04ee3 /src/core/nginx.c
parent9d639520aa95f0ff3882ea348d4347f69cbae493 (diff)
downloadnginx-b8c367c7b9155857f1c068624aa059830db57fa8.tar.gz
nginx-b8c367c7b9155857f1c068624aa059830db57fa8.zip
nginx-0.0.1-2003-07-10-20:26:57 import
Diffstat (limited to 'src/core/nginx.c')
-rw-r--r--src/core/nginx.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c
index 1de6e3258..fd2f2db03 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -61,7 +61,20 @@ int main(int argc, char *const *argv)
ngx_cycle = cycle;
- /* daemon */
+#if !(WIN32)
+
+ if (0) {
+ if (ngx_daemon(cycle->log) == NGX_ERROR) {
+ return 1;
+ }
+ }
+
+ if (dup2(cycle->log->file->fd, STDERR_FILENO) == -1) {
+ ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, "dup2(STDERR) failed");
+ return 1;
+ }
+
+#endif
/* life cycle */
@@ -154,7 +167,7 @@ static ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle, ngx_log_t *log)
cycle->open_files.nalloc = n;
cycle->open_files.pool = pool;
- cycle->log = ngx_log_create_errlog(cycle);
+ cycle->log = ngx_log_create_errlog(cycle, NULL);
if (cycle->log == NULL) {
ngx_destroy_pool(pool);
return NULL;