Skip to content

Commit

Permalink
Work around lack of execvpe on FreeBSD
Browse files Browse the repository at this point in the history
Commit 06468ef switched `test-ptrace.c`
to use `execvpe` instead of `execve`. However, the former doesn't exist
on FreeBSD. This now adds a guard such that `execve` is used on FreeBSD
and `execvpe` is retained on other systems.
  • Loading branch information
ararslan authored and djwatson committed Nov 30, 2021
1 parent ea65026 commit 6a77892
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test-ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,11 @@ main (int argc, char **argv)
fprintf(stderr, "Need to specify a command line for the child\n");
exit (-1);
}
#ifdef __FreeBSD__
execve (argv[optind], argv + optind, environ);
#else
execvpe (argv[optind], argv + optind, environ);
#endif
_exit (-1);
}
atexit (target_pid_kill);
Expand Down

0 comments on commit 6a77892

Please sign in to comment.