nginx-0.0.1-2003-07-10-20:26:57 import
diff --git a/src/core/nginx.c b/src/core/nginx.c
index 1de6e32..fd2f2db 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -61,7 +61,20 @@
 
     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 @@
     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;