diff options
author | Stefan Zabka <zabkaste@hu-berlin.de> | 2020-05-25 20:31:34 +0200 |
---|---|---|
committer | Stefan Zabka <zabkaste@hu-berlin.de> | 2020-05-25 20:31:34 +0200 |
commit | 0954865f4f4afc9dcc0ad0527f965030136e2f12 (patch) | |
tree | 000636dc4df461c8fcdd48562bd8001eac5f2216 | |
parent | dc86ffee1c7f05a30a1eff63a8348a4a73659451 (diff) | |
parent | 9b1a0928001aacc4420617ab1b6c84dcb16f7e75 (diff) | |
download | betriebssysteme-0954865f4f4afc9dcc0ad0527f965030136e2f12.tar.gz betriebssysteme-0954865f4f4afc9dcc0ad0527f965030136e2f12.zip |
Merge branch 'abgabe2' of git.niklashalle.net:uni/sem6/betriebssysteme into abgabe2
-rw-r--r-- | 02_exercise/builtins.c | 6 | ||||
-rw-r--r-- | 02_exercise/shell.c | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/02_exercise/builtins.c b/02_exercise/builtins.c index 4ab4c7c..8b23c74 100644 --- a/02_exercise/builtins.c +++ b/02_exercise/builtins.c @@ -62,6 +62,9 @@ void builtin_wait(process p, bool bind) { perror("Could not wait for process"); } } else { + if (bind) { + printf("[%i] ", WEXITSTATUS(status)); + } else { printf("[%i] TERMINATED\n", current_pid); if (WIFEXITED(status)) { printf("[%i] exited normally with status: %i\n", current_pid, @@ -76,10 +79,11 @@ void builtin_wait(process p, bool bind) { printf("[%i] exited (not sure why), exit status: %i\n", current_pid, WEXITSTATUS(status)); } + } } signal(SIGINT, SIG_DFL); } } arrayRelease(pids); -}
\ No newline at end of file +} diff --git a/02_exercise/shell.c b/02_exercise/shell.c index 03ff6b3..2452347 100644 --- a/02_exercise/shell.c +++ b/02_exercise/shell.c @@ -14,7 +14,6 @@ process *processes; void signal_handler(int signal) { - printf("Received signal %d", signal); if (signal == SIGINT) { for (size_t i = 0; i < arrayLen(processes); ++i) { pid_t pid = processes[i].pid; |