c89 msh_executE

This commit is contained in:
IoIxD 2026-01-22 17:13:40 -07:00
commit c3199feafd

View file

@ -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);
} }