aboutsummaryrefslogtreecommitdiff
path: root/src/core/nginx.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-04-19 16:06:09 +0000
committerIgor Sysoev <igor@sysoev.ru>2009-04-19 16:06:09 +0000
commit1153aa646573103baa9868f668eb8a562ec8cf63 (patch)
tree1fde80940516fd831c54a04328ab01b5621d9bbb /src/core/nginx.c
parentd7fe6406720e5d5307dc1164f5f95c68f7b9fe7b (diff)
downloadnginx-1153aa646573103baa9868f668eb8a562ec8cf63.tar.gz
nginx-1153aa646573103baa9868f668eb8a562ec8cf63.zip
show -t results on stderr
Diffstat (limited to 'src/core/nginx.c')
-rw-r--r--src/core/nginx.c33
1 files changed, 7 insertions, 26 deletions
diff --git a/src/core/nginx.c b/src/core/nginx.c
index e6ebae544..a542eca74 100644
--- a/src/core/nginx.c
+++ b/src/core/nginx.c
@@ -191,8 +191,6 @@ static char **ngx_os_environ;
int ngx_cdecl
main(int argc, char *const *argv)
{
- char *p;
- ssize_t n;
ngx_int_t i;
ngx_log_t *log;
ngx_cycle_t *cycle, init_cycle;
@@ -243,29 +241,14 @@ main(int argc, char *const *argv)
if (ngx_show_version) {
- p = "nginx version: " NGINX_VER CRLF;
- n = sizeof("nginx version: " NGINX_VER CRLF) - 1;
-
- if (ngx_write_fd(ngx_stderr_fileno, p, n) != n) {
- return 1;
- }
+ ngx_log_stderr("nginx version: " NGINX_VER);
if (ngx_show_configure) {
#ifdef NGX_COMPILER
- p = "built by " NGX_COMPILER CRLF;
- n = sizeof("built by " NGX_COMPILER CRLF) - 1;
-
- if (ngx_write_fd(ngx_stderr_fileno, p, n) != n) {
- return 1;
- }
+ ngx_log_stderr("built by " NGX_COMPILER);
#endif
- p = "configure arguments: " NGX_CONFIGURE CRLF;
- n = sizeof("configure arguments :" NGX_CONFIGURE CRLF) - 1;
-
- if (ngx_write_fd(ngx_stderr_fileno, p, n) != n) {
- return 1;
- }
+ ngx_log_stderr("configure arguments: " NGX_CONFIGURE);
}
if (!ngx_test_config) {
@@ -301,18 +284,16 @@ main(int argc, char *const *argv)
cycle = ngx_init_cycle(&init_cycle);
if (cycle == NULL) {
if (ngx_test_config) {
- ngx_log_error(NGX_LOG_EMERG, log, 0,
- "the configuration file %s test failed",
- init_cycle.conf_file.data);
+ ngx_log_stderr("the configuration file %s test failed",
+ init_cycle.conf_file.data);
}
return 1;
}
if (ngx_test_config) {
- ngx_log_error(NGX_LOG_INFO, log, 0,
- "the configuration file %s was tested successfully",
- cycle->conf_file.data);
+ ngx_log_stderr("the configuration file %s was tested successfully",
+ cycle->conf_file.data);
return 0;
}