From 4ecb4d721de0d6ddc34dfff4dce294415b64b04b Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Fri, 21 Apr 2006 12:06:44 +0000 Subject: nginx-0.3.41-RELEASE import *) Feature: the -v switch. *) Bugfix: the segmentation fault may occurred if the SSI page has remote subrequests. *) Bugfix: in FastCGI handling. *) Bugfix: if the perl modules path was not set using --with-perl_modules_path=PATH or the "perl_modules", then the segmentation fault was occurred. --- src/core/nginx.c | 19 ++++++++++++++++++- src/core/nginx.h | 2 +- src/core/ngx_log.c | 2 ++ 3 files changed, 21 insertions(+), 2 deletions(-) (limited to 'src/core') diff --git a/src/core/nginx.c b/src/core/nginx.c index 12a2b8a25..484919862 100644 --- a/src/core/nginx.c +++ b/src/core/nginx.c @@ -175,7 +175,9 @@ ngx_module_t ngx_core_module = { ngx_uint_t ngx_max_module; -static char *ngx_null_environ = NULL; +static ngx_uint_t ngx_show_version; + +static char *ngx_null_environ = NULL; int ngx_cdecl @@ -229,6 +231,17 @@ main(int argc, char *const *argv) return 1; } + if (ngx_show_version) { + ngx_write_fd(ngx_stderr_fileno, "nginx version: " NGINX_VER CRLF, + sizeof("nginx version: " NGINX_VER CRLF) - 1); + +#ifdef NGX_COMPILER + ngx_write_fd(ngx_stderr_fileno, "built by " NGX_COMPILER CRLF, + sizeof("built by " NGX_COMPILER CRLF) - 1); +#endif + return 0; + } + if (ngx_test_config) { log->log_level = NGX_LOG_INFO; } @@ -472,6 +485,10 @@ ngx_getopt(ngx_cycle_t *cycle, int argc, char *const *argv) switch (argv[i][1]) { + case 'v': + ngx_show_version = 1; + break; + case 't': ngx_test_config = 1; break; diff --git a/src/core/nginx.h b/src/core/nginx.h index 2e13e6be4..ec230610f 100644 --- a/src/core/nginx.h +++ b/src/core/nginx.h @@ -8,7 +8,7 @@ #define _NGINX_H_INCLUDED_ -#define NGINX_VER "nginx/0.3.40" +#define NGINX_VER "nginx/0.3.41" #define NGINX_VAR "NGINX" #define NGX_OLDPID_EXT ".oldbin" diff --git a/src/core/ngx_log.c b/src/core/ngx_log.c index 9e23592ea..21d59780f 100644 --- a/src/core/ngx_log.c +++ b/src/core/ngx_log.c @@ -198,6 +198,8 @@ ngx_log_init(void) #if (NGX_WIN32) + ngx_stderr_fileno = GetStdHandle(STD_ERROR_HANDLE); + ngx_stderr.fd = ngx_open_file(NGX_ERROR_LOG_PATH, NGX_FILE_RDWR, NGX_FILE_CREATE_OR_OPEN|NGX_FILE_APPEND); -- cgit