fix kill message
This commit is contained in:
parent
0fff4a10c3
commit
4814482cb2
1 changed files with 10 additions and 8 deletions
|
|
@ -194,26 +194,28 @@ int msh_execute(char *cmd, char **args) {
|
|||
|
||||
msh_linux_setup_signals();
|
||||
|
||||
ret = (SIZE_TYPE)SYSCALL(wait4, fork, &status, 0, &ru);
|
||||
SYSCALL(wait4, fork, &status, 0, &ru);
|
||||
|
||||
SYSCALL(kill, fork, SIGKILL);
|
||||
|
||||
SYSCALL(write, 1, "\r", 2);
|
||||
|
||||
msh_linux_start_input_capture();
|
||||
|
||||
char pid_str[16];
|
||||
itoa(fork, pid_str, 10);
|
||||
|
||||
if (WIFSIGNALED(status)) {
|
||||
msh_print_strings(pid_str, "\t", (char *)signal_table[WTERMSIG(status)],
|
||||
"\t", cmd, "\r\n", 0);
|
||||
return WTERMSIG(status);
|
||||
msh_print_strings(pid_str, " ", (char *)signal_table[WTERMSIG(status)],
|
||||
" ", cmd, "\n\r", 0);
|
||||
ret = WTERMSIG(status);
|
||||
} else if (WIFSTOPPED(status)) {
|
||||
msh_print_strings(pid_str, "\tstopped\t", cmd, "\r\n", 0);
|
||||
msh_print_strings(pid_str, "\tstopped\t", cmd, "\n\r", 0);
|
||||
ret = WEXITSTATUS(status);
|
||||
} else {
|
||||
return WEXITSTATUS(status);
|
||||
ret = WEXITSTATUS(status);
|
||||
}
|
||||
|
||||
msh_linux_start_input_capture();
|
||||
return ret;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue