fix zombie process
This commit is contained in:
parent
5506e06840
commit
f87f138f42
@ -38,7 +38,8 @@ void launch_program(StringArray *args) {
|
|||||||
argv[args->size] = NULL;
|
argv[args->size] = NULL;
|
||||||
|
|
||||||
execvp(args->array[0], argv);
|
execvp(args->array[0], argv);
|
||||||
perror("execvpe");
|
fprintf(stderr, "%s: command not found\n", args->array[0]);
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
else if (child < 0) {
|
else if (child < 0) {
|
||||||
perror("fork");
|
perror("fork");
|
||||||
|
Loading…
Reference in New Issue
Block a user