diff options
author | Max Romanov <max.romanov@nginx.com> | 2017-09-05 10:22:45 -0700 |
---|---|---|
committer | Max Romanov <max.romanov@nginx.com> | 2017-09-05 10:22:45 -0700 |
commit | 1429cacd1738e6d3dde3a155228c4109de50984a (patch) | |
tree | 1f79c49e2e7b769051975e06182f5aa16dfbeb05 /src/nxt_go.c | |
parent | f1685e371fe8a3bb9442fe2c5e0e33f5da0ac4f9 (diff) | |
download | unit-1429cacd1738e6d3dde3a155228c4109de50984a.tar.gz unit-1429cacd1738e6d3dde3a155228c4109de50984a.tar.bz2 |
Using CSTRZ mapping type for go executable.
Diffstat (limited to '')
-rw-r--r-- | src/nxt_go.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/src/nxt_go.c b/src/nxt_go.c index 28d681ee..37f4de01 100644 --- a/src/nxt_go.c +++ b/src/nxt_go.c @@ -38,7 +38,6 @@ nxt_sock_no_cloexec(nxt_socket_t fd) static nxt_int_t nxt_go_init(nxt_task_t *task, nxt_common_app_conf_t *conf) { - char *go_path; char *argv[2]; u_char buf[256]; u_char *p; @@ -86,16 +85,13 @@ nxt_go_init(nxt_task_t *task, nxt_common_app_conf_t *conf) setenv("NXT_GO_PORTS", (char *)buf, 1); - go_path = malloc(c->executable.length + 1); - nxt_memcpy(go_path, c->executable.start, c->executable.length); - go_path[c->executable.length] = '\0'; - - argv[0] = go_path; + argv[0] = c->executable; argv[1] = NULL; - (void) execve(go_path, argv, environ); + (void) execve(c->executable, argv, environ); - nxt_log(task, NXT_LOG_WARN, "execve(%s) failed %E", go_path, nxt_errno); + nxt_log(task, NXT_LOG_WARN, "execve(%s) failed %E", c->executable, + nxt_errno); return NXT_ERROR; } |