From 30b4f8816774665321e6903b4f55a929b015d16d Mon Sep 17 00:00:00 2001 From: David Gibson Date: Wed, 6 Nov 2024 10:25:20 +1100 Subject: [PATCH] arch: Avoid explicit access to 'environ' 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 Signed-off-by: Stefano Brivio --- 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"); } }