Compare commits
No commits in common. "de167c3c67f7f65292e1f98cc66ed9a91051cf3c" and "44bd93b8b4ac9690a4d5afc04605c87f0c56d184" have entirely different histories.
de167c3c67
...
44bd93b8b4
@ -5,7 +5,7 @@
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static int status = 0;
|
||||
static int status;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
@ -16,8 +16,6 @@ typedef struct
|
||||
|
||||
void show_prompt()
|
||||
{
|
||||
if (status) { printf("%d [%ld]> ", WEXITSTATUS(status), getpid()); }
|
||||
else
|
||||
printf("[%ld]> ", getpid());
|
||||
}
|
||||
|
||||
@ -119,6 +117,8 @@ void command_execute(command* cmd)
|
||||
}
|
||||
int exit_status = WEXITSTATUS(status);
|
||||
if (exit_status == -2 || exit_status == -3) printf("(PID %ld) Segmentation fault\n", result);
|
||||
else if (exit_status)
|
||||
printf("Exited with code %d\n", WEXITSTATUS(status));
|
||||
command_clear(cmd);
|
||||
show_prompt();
|
||||
}
|
||||
|
@ -490,13 +490,7 @@ void sys_waitpid(Context* context, long pid, int* wstatus,
|
||||
*kwstatus = (int)(child->exit_status & 0xff);
|
||||
release_user_ref(kwstatus);
|
||||
}
|
||||
else
|
||||
{
|
||||
kinfoln("wstatus ptr is invalid: %p", (void*)wstatus);
|
||||
child->state = child->Exited;
|
||||
context->rax = -EFAULT;
|
||||
return;
|
||||
}
|
||||
else { kinfoln("wstatus ptr is invalid: %p", (void*)wstatus); }
|
||||
}
|
||||
child->state = child->Exited;
|
||||
context->rax = (long)child->id;
|
||||
|
Loading…
Reference in New Issue
Block a user