diff options
Diffstat (limited to 'arch.c')
-rw-r--r-- | arch.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -19,6 +19,7 @@ #include <unistd.h> #include "log.h" +#include "util.h" /** * arch_avx2_exec() - Switch to AVX2 build if supported @@ -40,8 +41,11 @@ void arch_avx2_exec(char **argv) if (__builtin_cpu_supports("avx2")) { char new_path[PATH_MAX + sizeof(".avx2")]; - snprintf(new_path, PATH_MAX + sizeof(".avx2"), "%s.avx2", exe); - execve(new_path, argv, environ); + if (snprintf_check(new_path, PATH_MAX + sizeof(".avx2"), + "%s.avx2", exe)) + die_perror("Can't build AVX2 executable path"); + + execv(new_path, argv); warn_perror("Can't run AVX2 build, using non-AVX2 version"); } } |