From: Cyrill Gorcunov <gorcunov@gmail.com> To: tml <tarantool-patches@dev.tarantool.org> Subject: [Tarantool-patches] [PATCH 1/2] popen: do not require space for shell args Date: Tue, 24 Mar 2020 13:03:46 +0300 [thread overview] Message-ID: <20200324100347.15405-2-gorcunov@gmail.com> (raw) In-Reply-To: <20200324100347.15405-1-gorcunov@gmail.com> In case of direct execute without using a shell there is no need to require a caller to allocate redundant space, lets pass executable name in first argument. Since this is yet testing api we're allowed to change without breaking aything. Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com> --- src/lib/core/popen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/core/popen.c b/src/lib/core/popen.c index a0630e3d9..6b6062215 100644 --- a/src/lib/core/popen.c +++ b/src/lib/core/popen.c @@ -945,7 +945,7 @@ popen_new(struct popen_opts *opts) if (opts->flags & POPEN_FLAG_SHELL) execve(_PATH_BSHELL, opts->argv, envp); else - execve(opts->argv[2], &opts->argv[2], envp); + execve(opts->argv[0], opts->argv, envp); exit_child: _exit(errno); unreachable(); -- 2.20.1
next prev parent reply other threads:[~2020-03-24 10:04 UTC|newest] Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-03-24 10:03 [Tarantool-patches] [PATCH 0/2] popen: fix unit test Cyrill Gorcunov 2020-03-24 10:03 ` Cyrill Gorcunov [this message] 2020-03-26 0:23 ` [Tarantool-patches] [PATCH 1/2] popen: do not require space for shell args Alexander Turenko 2020-03-24 10:03 ` [Tarantool-patches] [PATCH 2/2] test: unit/popen -- provide a child process Cyrill Gorcunov 2020-03-26 0:47 ` Alexander Turenko 2020-03-26 0:59 ` Nikita Pettik 2020-03-26 8:31 ` [Tarantool-patches] [PATCH v2 " Cyrill Gorcunov 2020-03-26 9:04 ` Cyrill Gorcunov 2020-03-24 10:04 ` [Tarantool-patches] [PATCH 0/2] popen: fix unit test Cyrill Gorcunov 2020-03-26 0:52 ` Alexander Turenko 2020-03-26 11:57 ` Kirill Yukhin
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20200324100347.15405-2-gorcunov@gmail.com \ --to=gorcunov@gmail.com \ --cc=tarantool-patches@dev.tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH 1/2] popen: do not require space for shell args' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox