X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2FCLIShell_src%2Fmain.c;h=ca06a0584deaab311dba073398690c34d689353c;hb=6df6a4c5493bd641a028c435be54c4d087f12000;hp=be621c40af63c23559bbaf0f400a918c37fd14bc;hpb=52fad670ab81459de0ff1bd0fa99a3396a6999e3;p=tpg%2Facess2.git diff --git a/Usermode/Applications/CLIShell_src/main.c b/Usermode/Applications/CLIShell_src/main.c index be621c40..ca06a058 100644 --- a/Usermode/Applications/CLIShell_src/main.c +++ b/Usermode/Applications/CLIShell_src/main.c @@ -75,6 +75,7 @@ int main(int argc, char *argv[], char **envp) if(saArgs[0]) free(saArgs[0]); printf("%s$ ", gsCurrentDirectory); + fflush(stdout); // Read Command line sCommandStr = Readline( readline_state ); @@ -206,19 +207,14 @@ void CallCommand(char **Args) } // Create new process - pid = clone(CLONE_VM, 0); - // Start Task - if(pid == 0) { - execve(sTmpBuffer, Args, gasEnvironment); - printf("Execve returned, ... oops\n"); - exit(-1); - } + int fds[] = {0, 1, 2}; + pid = _SysSpawn(sTmpBuffer, (const char **)Args, (const char **)gasEnvironment, 3, fds, NULL); if(pid <= 0) { printf("Unable to create process: `%s'\n", sTmpBuffer); // Error Message } else { int status; - waittid(pid, &status); + _SysWaitTID(pid, &status); } }