summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Zabka <zabkaste@hu-berlin.de>2020-05-25 20:31:34 +0200
committerStefan Zabka <zabkaste@hu-berlin.de>2020-05-25 20:31:34 +0200
commit0954865f4f4afc9dcc0ad0527f965030136e2f12 (patch)
tree000636dc4df461c8fcdd48562bd8001eac5f2216
parentdc86ffee1c7f05a30a1eff63a8348a4a73659451 (diff)
parent9b1a0928001aacc4420617ab1b6c84dcb16f7e75 (diff)
downloadbetriebssysteme-0954865f4f4afc9dcc0ad0527f965030136e2f12.tar.gz
betriebssysteme-0954865f4f4afc9dcc0ad0527f965030136e2f12.zip
Merge branch 'abgabe2' of git.niklashalle.net:uni/sem6/betriebssysteme into abgabe2
-rw-r--r--02_exercise/builtins.c6
-rw-r--r--02_exercise/shell.c1
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;