diff --git a/test/test-25069c12.c b/test/test-25069c12.c index 1f6cd52..b9f27fa 100644 --- a/test/test-25069c12.c +++ b/test/test-25069c12.c @@ -1,14 +1,15 @@ -#include /* execve(2), */ -#include /* exit(3), */ +#include /* execv(2), */ +#include /* exit(3), getenv(3), setenv(3), */ #include /* strcmp(3), */ int main(int argc, char *argv[]) { char *void_array[] = { NULL }; - if (argc == 0) + if (getenv("PROC_SELF_EXE") != NULL) exit(EXIT_SUCCESS); - execve("/proc/self/exe", void_array, void_array); + setenv("PROC_SELF_EXE", "1", 1); + execv("/proc/self/exe", void_array); exit(EXIT_FAILURE); } diff --git a/test/test-25069c13.c b/test/test-25069c13.c index dc14733..af8b8d8 100644 --- a/test/test-25069c13.c +++ b/test/test-25069c13.c @@ -1,12 +1,13 @@ -#include /* execve(2), */ -#include /* exit(3), */ +#include /* execv(2), */ +#include /* exit(3), getenv(3), setenv(3), */ #include /* strcmp(3), */ int main(int argc, char *argv[]) { - if (argc == 0) + if (getenv("PROC_SELF_EXE") != NULL) exit(EXIT_SUCCESS); - execve("/proc/self/exe", NULL, NULL); + setenv("PROC_SELF_EXE", "1", 1); + execv("/proc/self/exe", NULL); exit(EXIT_FAILURE); }