Florian Krohm dc3f09be77 Fix BZ 339789. /bin/true does not exist on Darwin.
Patch by rhyskidd@gmail.com.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@14645
2014-10-20 21:29:26 +00:00

24 lines
478 B
C

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
int main(int argc, char **argv)
{
if (argc == 1)
{
// This tests the case where argv and envp are NULL, which is easy to
// get wrong because it's an unusual case.
# if !defined(VGO_darwin)
if (execve("/bin/true", NULL, NULL) < 0)
# else
if (execve("/usr/bin/true", NULL, NULL) < 0)
# endif
{
perror("execve");
exit(1);
}
}
exit(0);
}