fix(command): prevent failing execvp to return
This commit is contained in:
parent
4f09deb394
commit
16743edb4f
1 changed files with 3 additions and 1 deletions
|
@ -1,5 +1,7 @@
|
|||
#include "command.h"
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
@ -7,7 +9,7 @@ unsigned char invoke(struct Args args) {
|
|||
pid_t child = fork();
|
||||
if (child == 0) {
|
||||
execvp(args.argv[0], args.argv);
|
||||
return 1;
|
||||
exit(errno);
|
||||
}
|
||||
waitpid(child, NULL, 0);
|
||||
|
||||
|
|
Loading…
Reference in a new issue