From: John Hodge Date: Sun, 20 Nov 2011 07:20:40 +0000 (+0800) Subject: Usermode/CLIShell - Fixed not catching execve returning X-Git-Tag: rel0.14~86 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=4d45d15216040b78b91af7469a796797b6b03c4f;p=tpg%2Facess2.git Usermode/CLIShell - Fixed not catching execve returning --- diff --git a/Usermode/Applications/CLIShell_src/main.c b/Usermode/Applications/CLIShell_src/main.c index 58432daf..89bfe0d1 100644 --- a/Usermode/Applications/CLIShell_src/main.c +++ b/Usermode/Applications/CLIShell_src/main.c @@ -49,7 +49,7 @@ char **gasCommandHistory; int giCommandSpace = 0; // ==== CODE ==== -int main(int argc, char *argv[], char *envp[]) +int main(int argc, char *argv[], char **envp) { char *sCommandStr; char *saArgs[32] = {0}; @@ -391,8 +391,11 @@ void CallCommand(char **Args) // Create new process pid = clone(CLONE_VM, 0); // Start Task - if(pid == 0) + if(pid == 0) { execve(sTmpBuffer, Args, gasEnvironment); + printf("Execve returned, ... oops\n"); + exit(-1); + } if(pid <= 0) { printf("Unable to create process: `%s'\n", sTmpBuffer); // Error Message }