summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_main.c
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2017-01-17 20:00:00 +0300
committerIgor Sysoev <igor@sysoev.ru>2017-01-17 20:00:00 +0300
commit16cbf3c076a0aca6d47adaf3f719493674cf2363 (patch)
treee6530480020f62a2bdbf249988ec3e2a751d3927 /src/nxt_main.c
downloadunit-16cbf3c076a0aca6d47adaf3f719493674cf2363.tar.gz
unit-16cbf3c076a0aca6d47adaf3f719493674cf2363.tar.bz2
Initial version.
Diffstat (limited to 'src/nxt_main.c')
-rw-r--r--src/nxt_main.c45
1 files changed, 45 insertions, 0 deletions
diff --git a/src/nxt_main.c b/src/nxt_main.c
new file mode 100644
index 00000000..ea2061d6
--- /dev/null
+++ b/src/nxt_main.c
@@ -0,0 +1,45 @@
+
+/*
+ * Copyright (C) Igor Sysoev
+ * Copyright (C) NGINX, Inc.
+ */
+
+#include <nxt_main.h>
+#include <nxt_cycle.h>
+
+
+extern char **environ;
+
+
+int nxt_cdecl
+main(int argc, char **argv)
+{
+ nxt_int_t ret;
+ nxt_thread_t *thr;
+
+ static nxt_str_t nxt_config_name = nxt_string_zero("nginx.conf");
+
+ if (nxt_lib_start("nginman", argv, &environ) != NXT_OK) {
+ return 1;
+ }
+
+// nxt_main_log.level = NXT_LOG_INFO;
+
+ thr = nxt_thread();
+ nxt_thread_time_update(thr);
+
+ nxt_main_log.handler = nxt_log_time_handler;
+
+ nxt_log_error(NXT_LOG_INFO, thr->log, "nginman started");
+
+ ret = nxt_cycle_create(thr, NULL, NULL, &nxt_config_name, 0);
+
+ if (ret != NXT_OK) {
+ return 1;
+ }
+
+ nxt_event_engine_start(thr->engine);
+
+ nxt_unreachable();
+ return 0;
+}