From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 349524429A8 for ; Tue, 24 Mar 2020 13:04:03 +0300 (MSK) Received: by mail-lj1-f194.google.com with SMTP id f20so2037103ljm.0 for ; Tue, 24 Mar 2020 03:04:03 -0700 (PDT) From: Cyrill Gorcunov Date: Tue, 24 Mar 2020 13:03:46 +0300 Message-Id: <20200324100347.15405-2-gorcunov@gmail.com> In-Reply-To: <20200324100347.15405-1-gorcunov@gmail.com> References: <20200324100347.15405-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 1/2] popen: do not require space for shell args List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml 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 --- 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