aboutsummaryrefslogtreecommitdiff
path: root/src/http/modules/ngx_http_log_handler.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/http/modules/ngx_http_log_handler.c')
-rw-r--r--src/http/modules/ngx_http_log_handler.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/http/modules/ngx_http_log_handler.c b/src/http/modules/ngx_http_log_handler.c
index f61461ce7..38aa2331d 100644
--- a/src/http/modules/ngx_http_log_handler.c
+++ b/src/http/modules/ngx_http_log_handler.c
@@ -198,5 +198,19 @@ static char *ngx_http_log_set_log(ngx_conf_t *cf, ngx_command_t *cmd,
return ngx_conf_errstr;
}
+#if (WIN32)
+ if (ngx_file_append_mode(lcf->file.fd) == NGX_ERROR) {
+ err = ngx_errno;
+ len = ngx_snprintf(ngx_conf_errstr, sizeof(ngx_conf_errstr) - 1,
+ ngx_file_appned_mode_n " \"%s\" failed (%d: ",
+ lcf->file.name.data, err);
+ len += ngx_strerror_r(err, ngx_conf_errstr + len,
+ sizeof(ngx_conf_errstr) - len - 1);
+ ngx_conf_errstr[len++] = ')';
+ ngx_conf_errstr[len++] = '\0';
+ return ngx_conf_errstr;
+ }
+#endif
+
return NGX_CONF_OK;
}