aboutsummaryrefslogtreecommitdiff
path: root/src/core/ngx_log.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/ngx_log.c')
-rw-r--r--src/core/ngx_log.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/core/ngx_log.c b/src/core/ngx_log.c
index 8769bcdc6..28287122d 100644
--- a/src/core/ngx_log.c
+++ b/src/core/ngx_log.c
@@ -207,6 +207,14 @@ ngx_log_stderr(const char *fmt, ...)
ngx_linefeed(p);
+#if (NGX_WIN32)
+
+ if (ngx_stderr_fileno == NULL) {
+ ngx_stderr_fileno = GetStdHandle(STD_ERROR_HANDLE);
+ }
+
+#endif
+
(void) ngx_write_fd(ngx_stderr_fileno, errstr, p - errstr);
}
@@ -219,8 +227,6 @@ ngx_log_init(void)
#if (NGX_WIN32)
- ngx_stderr_fileno = GetStdHandle(STD_ERROR_HANDLE);
-
ngx_stderr.fd = ngx_open_file((u_char *) NGX_ERROR_LOG_PATH,
NGX_FILE_APPEND,
NGX_FILE_CREATE_OR_OPEN,