Skip to content

Commit

Permalink
Fix test-25069c12 and test-25069c13 for new kernels.
Browse files Browse the repository at this point in the history
Fix both tests in the same vein as [1].  Note that this behavior had been
changed by Linux's [2], not by glibc as suggested by [1].

[1] 10dd605
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=dcd46d897adb70d63e025f175a00a89797d31a43
  • Loading branch information
jpoiret authored and oxr463 committed May 13, 2023
1 parent c5a465e commit a5ee0b7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions test/test-25069c12.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
#include <unistd.h> /* execve(2), */
#include <stdlib.h> /* exit(3), */
#include <unistd.h> /* execv(2), */
#include <stdlib.h> /* exit(3), getenv(3), setenv(3), */
#include <string.h> /* 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);
}
9 changes: 5 additions & 4 deletions test/test-25069c13.c
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#include <unistd.h> /* execve(2), */
#include <stdlib.h> /* exit(3), */
#include <unistd.h> /* execv(2), */
#include <stdlib.h> /* exit(3), getenv(3), setenv(3), */
#include <string.h> /* 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);
}

0 comments on commit a5ee0b7

Please sign in to comment.