From 791cec1343d2bf50417637e9ba98890211263887 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrius=20=C5=A0tikonas?= Date: Mon, 26 Dec 2022 17:04:28 +0000 Subject: [PATCH] Add support for spawning in UEFI. --- cc_spawn.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cc_spawn.c b/cc_spawn.c index 1f7212e..e0cae4c 100644 --- a/cc_spawn.c +++ b/cc_spawn.c @@ -224,6 +224,10 @@ void _execute(char* name, char** array, char** envp) sanity_command_check(array); + int result; +#ifdef __uefi__ + result = spawn(program, array, envp); +#else int f = fork(); /* Ensure fork succeeded */ @@ -259,7 +263,8 @@ void _execute(char* name, char** array, char** envp) /* And we should wait for it to complete */ waitpid(f, &status, 0); - int result = what_exit(program ,status); + result = what_exit(program, status); +#endif if(0 != result) { fputs("Subprocess: ", stderr);