diff options
author | Igor Sysoev <igor@sysoev.ru> | 2009-04-21 19:40:40 +0400 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2009-04-21 19:40:40 +0400 |
commit | 19a0e6e32e3f4df38f7ec777d5a02e23a2efd382 (patch) | |
tree | 252fc86a877a5183e28815aaeb97a3cab084778a /src/core/ngx_log.c | |
parent | 890467c1c4cc9af79a92871f670fd775c6a7af0f (diff) |
fix r2731 for Win32
Diffstat (limited to 'src/core/ngx_log.c')
-rw-r--r-- | src/core/ngx_log.c | 10 |
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, |