diff options
author | Zhidao HONG <z.hong@f5.com> | 2023-05-08 16:00:25 +0800 |
---|---|---|
committer | Zhidao HONG <z.hong@f5.com> | 2023-05-08 16:00:25 +0800 |
commit | a3c3a29493798873ad04922bb2a7180b2ce267d5 (patch) | |
tree | 4332cbb50520c389d859db27e7266ffa53954b92 /src/nxt_runtime.c | |
parent | 56af7bb825c286e1a397f780bff9da275e5602ad (diff) | |
download | unit-a3c3a29493798873ad04922bb2a7180b2ce267d5.tar.gz unit-a3c3a29493798873ad04922bb2a7180b2ce267d5.tar.bz2 |
NJS: supported loadable modules.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_runtime.c | 17 |
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; |