summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_runtime.c
diff options
context:
space:
mode:
authorTiago Natel <t.nateldemoura@f5.com>2019-11-26 16:26:24 +0000
committerTiago Natel <t.nateldemoura@f5.com>2019-11-26 16:26:24 +0000
commit417cc7be7c0c6f6e62f0916f671bbf0a4460226b (patch)
tree1ca53595fb350ab3d9acab11965bcc98606741f7 /src/nxt_runtime.c
parenta3e5d095016166a78a45c9aade2b19d75d66833f (diff)
downloadunit-417cc7be7c0c6f6e62f0916f671bbf0a4460226b.tar.gz
unit-417cc7be7c0c6f6e62f0916f671bbf0a4460226b.tar.bz2
Refactor of process init.
Introduces the functions nxt_process_init_create() and nxt_process_init_creds_set().
Diffstat (limited to 'src/nxt_runtime.c')
-rw-r--r--src/nxt_runtime.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/nxt_runtime.c b/src/nxt_runtime.c
index 096aabc4..afd2cb66 100644
--- a/src/nxt_runtime.c
+++ b/src/nxt_runtime.c
@@ -705,7 +705,10 @@ nxt_runtime_conf_init(nxt_task_t *task, nxt_runtime_t *rt)
}
if (rt->capabilities.setid) {
- if (nxt_user_cred_get(task, &rt->user_cred, rt->group) != NXT_OK) {
+ ret = nxt_user_cred_get(task, rt->mem_pool, &rt->user_cred,
+ rt->group);
+
+ if (nxt_slow_path(ret != NXT_OK)) {
return NXT_ERROR;
}
@@ -1323,7 +1326,7 @@ nxt_runtime_process_release(nxt_runtime_t *rt, nxt_process_t *process)
nxt_thread_mutex_destroy(&process->cp_mutex);
if (process->init != NULL) {
- nxt_mp_free(rt->mem_pool, process->init);
+ nxt_mp_destroy(process->init->mem_pool);
}
nxt_mp_free(rt->mem_pool, process);