Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko <alexander.turenko@tarantool.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: tml <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH 1/2] popen: do not require space for shell args
Date: Thu, 26 Mar 2020 03:23:14 +0300	[thread overview]
Message-ID: <20200326002314.6couvb225onbeeqy@tkn_work_nb> (raw)
In-Reply-To: <20200324100347.15405-2-gorcunov@gmail.com>

I still think that we should remove the POPEN_FLAG_SHELL option,
because, in brief, it will simplify the popen engine API (see the last
point in [1]), but okay: let's proceed with the fix and postpone the
decision a bit.

LGTM.

[1]: https://lists.tarantool.org/pipermail/tarantool-patches/2020-March/014608.html

On Tue, Mar 24, 2020 at 01:03:46PM +0300, Cyrill Gorcunov wrote:
> 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
> 

  reply	other threads:[~2020-03-26  0:23 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 ` [Tarantool-patches] [PATCH 1/2] popen: do not require space for shell args Cyrill Gorcunov
2020-03-26  0:23   ` Alexander Turenko [this message]
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=20200326002314.6couvb225onbeeqy@tkn_work_nb \
    --to=alexander.turenko@tarantool.org \
    --cc=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