From 16743edb4f0f0829ef2decde5b83d4c1fe9c741b Mon Sep 17 00:00:00 2001 From: Ahurac Date: Fri, 8 Nov 2024 11:46:25 +0100 Subject: [PATCH] fix(command): prevent failing execvp to return --- src/command.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/command.c b/src/command.c index 400f5fe..7a55fed 100644 --- a/src/command.c +++ b/src/command.c @@ -1,5 +1,7 @@ #include "command.h" +#include +#include #include #include @@ -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);