summaryrefslogtreecommitdiffstats
path: root/usr.sbin/nginx/src/core/nginx.c
diff options
context:
space:
mode:
authorrobert <robert@openbsd.org>2012-01-05 12:28:58 +0000
committerrobert <robert@openbsd.org>2012-01-05 12:28:58 +0000
commit79a58b938f55fd9f7302ccafddf487453d11fb74 (patch)
tree3d175cfbdd2d88c13319b2e008ebeb391a6857b5 /usr.sbin/nginx/src/core/nginx.c
parentFix typos in comment (s,exacty,exactly,) (diff)
downloadwireguard-openbsd-79a58b938f55fd9f7302ccafddf487453d11fb74.tar.xz
wireguard-openbsd-79a58b938f55fd9f7302ccafddf487453d11fb74.zip
update to nginx-1.0.11
Diffstat (limited to 'usr.sbin/nginx/src/core/nginx.c')
-rw-r--r--usr.sbin/nginx/src/core/nginx.c59
1 files changed, 33 insertions, 26 deletions
diff --git a/usr.sbin/nginx/src/core/nginx.c b/usr.sbin/nginx/src/core/nginx.c
index b578617bee2..28c071e5541 100644
--- a/usr.sbin/nginx/src/core/nginx.c
+++ b/usr.sbin/nginx/src/core/nginx.c
@@ -203,6 +203,10 @@ main(int argc, char *const *argv)
ngx_cycle_t *cycle, init_cycle;
ngx_core_conf_t *ccf;
+#if (NGX_FREEBSD)
+ ngx_debug_init();
+#endif
+
if (ngx_strerror_init() != NGX_OK) {
return 1;
}
@@ -212,48 +216,51 @@ main(int argc, char *const *argv)
}
if (ngx_show_version) {
- ngx_log_stderr(0, "nginx version: " NGINX_VER);
+ ngx_write_stderr("nginx version: " NGINX_VER NGX_LINEFEED);
if (ngx_show_help) {
- ngx_log_stderr(0,
+ ngx_write_stderr(
"Usage: nginx [-?hvVtq] [-s signal] [-c filename] "
- "[-p prefix] [-g directives]" CRLF CRLF
- "Options:" CRLF
- " -?,-h : this help" CRLF
- " -v : show version and exit" CRLF
+ "[-p prefix] [-g directives]" NGX_LINEFEED
+ NGX_LINEFEED
+ "Options:" NGX_LINEFEED
+ " -?,-h : this help" NGX_LINEFEED
+ " -v : show version and exit" NGX_LINEFEED
" -V : show version and configure options then exit"
- CRLF
- " -t : test configuration and exit" CRLF
+ NGX_LINEFEED
+ " -t : test configuration and exit" NGX_LINEFEED
" -q : suppress non-error messages "
- "during configuration testing" CRLF
+ "during configuration testing" NGX_LINEFEED
" -s signal : send signal to a master process: "
- "stop, quit, reopen, reload" CRLF
+ "stop, quit, reopen, reload" NGX_LINEFEED
#ifdef NGX_PREFIX
" -p prefix : set prefix path (default: "
- NGX_PREFIX ")" CRLF
+ NGX_PREFIX ")" NGX_LINEFEED
#else
- " -p prefix : set prefix path (default: NONE)" CRLF
+ " -p prefix : set prefix path (default: NONE)" NGX_LINEFEED
#endif
" -c filename : set configuration file (default: "
- NGX_CONF_PATH ")" CRLF
+ NGX_CONF_PATH ")" NGX_LINEFEED
" -g directives : set global directives out of configuration "
- "file" CRLF
- " -u : disable chroot(2)" CRLF
+ "file" NGX_LINEFEED NGX_LINEFEED
+ " -u : disable chroot(2) "
+ "file" NGX_LINEFEED NGX_LINEFEED
);
}
if (ngx_show_configure) {
+ ngx_write_stderr(
#ifdef NGX_COMPILER
- ngx_log_stderr(0, "built by " NGX_COMPILER);
+ "built by " NGX_COMPILER NGX_LINEFEED
#endif
#if (NGX_SSL)
#ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME
- ngx_log_stderr(0, "TLS SNI support enabled");
+ "TLS SNI support enabled" NGX_LINEFEED
#else
- ngx_log_stderr(0, "TLS SNI support disabled");
+ "TLS SNI support disabled" NGX_LINEFEED
#endif
#endif
- ngx_log_stderr(0, "configure arguments:" NGX_CONFIGURE);
+ "configure arguments:" NGX_CONFIGURE NGX_LINEFEED);
}
if (!ngx_test_config) {
@@ -261,10 +268,6 @@ main(int argc, char *const *argv)
}
}
-#if (NGX_FREEBSD)
- ngx_debug_init();
-#endif
-
/* TODO */ ngx_max_sockets = -1;
ngx_time_init();
@@ -375,6 +378,10 @@ main(int argc, char *const *argv)
ngx_daemonized = 1;
}
+ if (ngx_inherited) {
+ ngx_daemonized = 1;
+ }
+
#endif
if (ngx_create_pidfile(&ccf->pid, cycle->log) != NGX_OK) {
@@ -765,9 +772,9 @@ ngx_get_options(int argc, char *const *argv)
ngx_log_stderr(0, "invalid option: \"-s %s\"", ngx_signal);
return NGX_ERROR;
- case 'u':
- ngx_chrooted = 0;
- break;
+ case 'u':
+ ngx_chrooted = 0;
+ break;
default:
ngx_log_stderr(0, "invalid option: \"%c\"", *(p - 1));