summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_runtime.c
diff options
context:
space:
mode:
authorZhidao HONG <z.hong@f5.com>2023-05-08 16:00:25 +0800
committerZhidao HONG <z.hong@f5.com>2023-05-08 16:00:25 +0800
commita3c3a29493798873ad04922bb2a7180b2ce267d5 (patch)
tree4332cbb50520c389d859db27e7266ffa53954b92 /src/nxt_runtime.c
parent56af7bb825c286e1a397f780bff9da275e5602ad (diff)
downloadunit-a3c3a29493798873ad04922bb2a7180b2ce267d5.tar.gz
unit-a3c3a29493798873ad04922bb2a7180b2ce267d5.tar.bz2
NJS: supported loadable modules.
Diffstat (limited to '')
-rw-r--r--src/nxt_runtime.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nxt_runtime.c b/src/nxt_runtime.c
index 1da52da0..96f801fb 100644
--- a/src/nxt_runtime.c
+++ b/src/nxt_runtime.c
@@ -906,6 +906,23 @@ nxt_runtime_conf_init(nxt_task_t *task, nxt_runtime_t *rt)
"mkdir(%s) failed %E", file_name.start, nxt_errno);
}
+ ret = nxt_file_name_create(rt->mem_pool, &file_name, "%s%sscripts/%Z",
+ rt->state, slash);
+ if (nxt_slow_path(ret != NXT_OK)) {
+ return NXT_ERROR;
+ }
+
+ ret = mkdir((char *) file_name.start, S_IRWXU);
+
+ if (nxt_fast_path(ret == 0 || nxt_errno == EEXIST)) {
+ rt->scripts.length = file_name.len;
+ rt->scripts.start = file_name.start;
+
+ } else {
+ nxt_alert(task, "Unable to create scripts storage directory: "
+ "mkdir(%s) failed %E", file_name.start, nxt_errno);
+ }
+
control.length = nxt_strlen(rt->control);
control.start = (u_char *) rt->control;