diff options
Diffstat (limited to '')
-rw-r--r-- | src/nxt_runtime.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/nxt_runtime.c b/src/nxt_runtime.c index ff4dd54d..fcae4ed8 100644 --- a/src/nxt_runtime.c +++ b/src/nxt_runtime.c @@ -794,14 +794,16 @@ static nxt_int_t nxt_runtime_conf_read_cmd(nxt_task_t *task, nxt_runtime_t *rt) { char *p, **argv; + u_char *end; nxt_str_t addr; nxt_sockaddr_t *sa; + u_char buf[1024]; const static char version[] = "nginext version: " NXT_VERSION "\n" "configured as ./configure" NXT_CONFIGURE_OPTIONS "\n"; - argv = nxt_process_argv; + argv = &nxt_process_argv[1]; while (*argv != NULL) { p = *argv++; @@ -909,6 +911,11 @@ nxt_runtime_conf_read_cmd(nxt_task_t *task, nxt_runtime_t *rt) write(STDERR_FILENO, version, sizeof(version) - 1); exit(0); } + + end = nxt_sprintf(buf, buf + sizeof(buf), "unknown option \"%s\"\n", p); + write(STDERR_FILENO, buf, end - buf); + + return NXT_ERROR; } return NXT_OK; |