Compare commits
No commits in common. "34b099fc3309f5a161a33a72c1ca87e8a96dfe6b" and "7ed3ffc7ea4000096e7253fdb741f55903fd14b3" have entirely different histories.
34b099fc33
...
7ed3ffc7ea
2 changed files with 2 additions and 5 deletions
2
Makefile
2
Makefile
|
@ -15,7 +15,7 @@ build/child: build
|
|||
|
||||
.PHONY: test
|
||||
test: all
|
||||
@echo "==> Testing execve with &NULL..."
|
||||
@echo "==> Testing execve with { NULL }..."
|
||||
./build/parent-ptr ./build/child
|
||||
@echo "==> Testing execve with NULL..."
|
||||
./build/parent-null ./build/child
|
||||
|
|
|
@ -1,11 +1,9 @@
|
|||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
#include <string.h>
|
||||
|
||||
int
|
||||
main(int argc, char **argv, char **envp)
|
||||
{
|
||||
int ret = 0;
|
||||
char *arr = NULL;
|
||||
char **ptr =
|
||||
#ifdef PTR_TO_NULL
|
||||
|
@ -16,8 +14,7 @@ main(int argc, char **argv, char **envp)
|
|||
printf("%s: using just NULL as argv...\n", argv[0]);
|
||||
#endif
|
||||
printf("%s: argv == %p\n", argv[0], ptr);
|
||||
ret = execve(argv[1], ptr, envp);
|
||||
execve(argv[1], ptr, envp);
|
||||
|
||||
printf("%s: execve failed ;_; got %s\n", argv[0], strerror(ret));
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue