c89 msh_executE
This commit is contained in:
parent
313d344212
commit
c3199feafd
1 changed files with 3 additions and 6 deletions
|
|
@ -190,7 +190,8 @@ int msh_execute(char *cmd, char **args) {
|
||||||
int status;
|
int status;
|
||||||
struct rusage ru;
|
struct rusage ru;
|
||||||
SIZE_TYPE ret;
|
SIZE_TYPE ret;
|
||||||
char *status_str;
|
char pid_str[16];
|
||||||
|
itoa(fork, pid_str, 10);
|
||||||
|
|
||||||
msh_linux_setup_signals();
|
msh_linux_setup_signals();
|
||||||
|
|
||||||
|
|
@ -198,11 +199,6 @@ int msh_execute(char *cmd, char **args) {
|
||||||
|
|
||||||
SYSCALL(kill, fork, SIGKILL);
|
SYSCALL(kill, fork, SIGKILL);
|
||||||
|
|
||||||
SYSCALL(write, 1, "\r", 2);
|
|
||||||
|
|
||||||
char pid_str[16];
|
|
||||||
itoa(fork, pid_str, 10);
|
|
||||||
|
|
||||||
if (WIFSIGNALED(status)) {
|
if (WIFSIGNALED(status)) {
|
||||||
msh_print_strings(pid_str, " ", (char *)signal_table[WTERMSIG(status)],
|
msh_print_strings(pid_str, " ", (char *)signal_table[WTERMSIG(status)],
|
||||||
" ", cmd, "\n\r", 0);
|
" ", cmd, "\n\r", 0);
|
||||||
|
|
@ -211,6 +207,7 @@ int msh_execute(char *cmd, char **args) {
|
||||||
msh_print_strings(pid_str, "\tstopped\t", cmd, "\n\r", 0);
|
msh_print_strings(pid_str, "\tstopped\t", cmd, "\n\r", 0);
|
||||||
ret = WEXITSTATUS(status);
|
ret = WEXITSTATUS(status);
|
||||||
} else {
|
} else {
|
||||||
|
SYSCALL(write, 1, "\r", 2);
|
||||||
ret = WEXITSTATUS(status);
|
ret = WEXITSTATUS(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue