From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202410 header.b=et7CHyLr; dkim-atps=neutral Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id D544F5A061C for ; Wed, 06 Nov 2024 00:27:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202410; t=1730849254; bh=eYXANPWq9lxRUme+R0CvGoAVdCMTptoHR3nvvXZ1kwM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=et7CHyLrBlqNXDK2FUCZd6M1hhvfQrUCDhFQNhcpFmidQfh7+6UCCp4lL11LGVCUo zQ8tDbpeFM/rwoDRtyYTKtgUrYC0s/NB+vRdoZ9rnpLCuPW/CvjwDbiT+h8YYEFSMX XIK/GyoC8Ym+BLuzsToQLcc0iQI7fGg28rbR/zrB5tgCfHsYfe67akkJdCN8t8/G7a 1skLUOVsnreGHXHFdZykhT0KcPhzxovYeBMdYZDZgS9ws12CvxBVCdFkNr8H84j2f0 9opnuF06rXP1CsIfUTcZiqZhlCEnsWtPPoQWYBOilCMraJTQXbiWnqqWsuJnB9Lfrr JO6NLaFgV3v4A== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4XjkyZ41HNz4xD9; Wed, 6 Nov 2024 10:27:34 +1100 (AEDT) From: David Gibson To: Stefano Brivio , passt-dev@passt.top Subject: [PATCH 04/12] arch: Avoid explicit access to 'environ' Date: Wed, 6 Nov 2024 10:25:20 +1100 Message-ID: <20241105232528.1408144-5-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241105232528.1408144-1-david@gibson.dropbear.id.au> References: <20241105232528.1408144-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: 7RGYKK4VJOWSGS5YMBAPPCICMKJQ2AA2 X-Message-ID-Hash: 7RGYKK4VJOWSGS5YMBAPPCICMKJQ2AA2 X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: We pass 'environ' to execve() in arch_avc2_exec(), so that we retain the environment in the current process. But the declaration of 'environ' is a bit weird - it doesn't seem to be in a standard header, requiring a manual explicit declaration. But, we can avoid needing to reference it explicitly by using execv() instead of execve(). This removes a clang warning. Signed-off-by: David Gibson --- arch.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch.c b/arch.c index d1dfb73..e1ee729 100644 --- a/arch.c +++ b/arch.c @@ -45,7 +45,7 @@ void arch_avx2_exec(char **argv) "%s.avx2", exe)) die_perror("Can't build AVX2 executable path"); - execve(new_path, argv, environ); + execv(new_path, argv); warn_perror("Can't run AVX2 build, using non-AVX2 version"); } } -- 2.47.0