diff src/core/nginx.c @ 115:be27f922b9a2

nginx-0.0.1-2003-07-10-20:26:57 import
author Igor Sysoev <igor@sysoev.ru>
date Thu, 10 Jul 2003 16:26:57 +0000
parents ac69ab96328d
children f6e3c5d019b6
line wrap: on
line diff
--- 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_c
     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;