diff --git a/0_CProgrammingLab/cprogramminglab-handout.tar b/0_CProgrammingLab/cprogramminglab-handout.tar deleted file mode 100644 index 23c8844..0000000 Binary files a/0_CProgrammingLab/cprogramminglab-handout.tar and /dev/null differ diff --git a/5_ShellLab/shlab-handout/tsh.c b/5_ShellLab/shlab-handout/tsh.c index cc835d6..8d6625d 100644 --- a/5_ShellLab/shlab-handout/tsh.c +++ b/5_ShellLab/shlab-handout/tsh.c @@ -389,12 +389,13 @@ void sigchld_handler(int sig) { } else if (WIFSIGNALED(status)) { // Child process is terminated by signal of WTERMSIG(code) deletejob(jobs, pid); - printf("Job [%d] (%d) terminated by signal %d\n", + sio_put("Job [%d] (%d) terminated by signal %d\n", jid, pid, WTERMSIG(status)); + // instead of using printf, use sio_put to avoid interleaving. } else if (WIFSTOPPED(status)) { // child process was stopped by signal of WSTOPSIG(code) setjobstate(jobs, pid, ST); - printf("Job [%d] (%d) stopped by signal %d\n", + sio_put("Job [%d] (%d) stopped by signal %d\n", jid, pid, WSTOPSIG(status)); }