aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aufgabe2/conv.c6
-rw-r--r--aufgabe2/log.c8
-rw-r--r--aufgabe2/monitor.c7
-rw-r--r--aufgabe2/statistic.c7
4 files changed, 28 insertions, 0 deletions
diff --git a/aufgabe2/conv.c b/aufgabe2/conv.c
index 1c2e1b5..6a433fb 100644
--- a/aufgabe2/conv.c
+++ b/aufgabe2/conv.c
@@ -14,6 +14,12 @@ FILE *pipe_stat;
void conv() {
int random_number = 0;
+ /* ungenutzte Pipeköpfe schließen */
+ close(queue[D_CONV_TO_LOG][READ]);
+ close(queue[D_CONV_TO_STAT][READ]);
+ close(queue[D_STAT_TO_MON][READ]);
+ close(queue[D_STAT_TO_MON][WRITE]);
+
printf("conv started\n");
/* Die beiden Pipes zum schreiben öffnen */
diff --git a/aufgabe2/log.c b/aufgabe2/log.c
index 14684ce..779b25b 100644
--- a/aufgabe2/log.c
+++ b/aufgabe2/log.c
@@ -13,6 +13,14 @@ FILE *logfile;
char *message;
void log() {
+ /* ungenutzte Pipeköpfe schließen */
+ close(queue[D_CONV_TO_LOG][WRITE]);
+ close(queue[D_CONV_TO_STAT][READ]);
+ close(queue[D_CONV_TO_STAT][WRITE]);
+ close(queue[D_STAT_TO_MON][READ]);
+ close(queue[D_STAT_TO_MON][WRITE]);
+
+
printf("log started\n");
/* Die Pipe zum lesen öffnen */
diff --git a/aufgabe2/monitor.c b/aufgabe2/monitor.c
index cb7ed29..b07cec6 100644
--- a/aufgabe2/monitor.c
+++ b/aufgabe2/monitor.c
@@ -14,6 +14,13 @@ char *message;
void monitor() {
int buffer;
+ /* ungenutzte Pipeköpfe schließen */
+ close(queue[D_CONV_TO_LOG][READ]);
+ close(queue[D_CONV_TO_LOG][WRITE]);
+ close(queue[D_CONV_TO_STAT][READ]);
+ close(queue[D_CONV_TO_STAT][WRITE]);
+ close(queue[D_STAT_TO_MON][WRITE]);
+
printf("monitor started\n");
/* Die Pipe zum lesen öffnen */
diff --git a/aufgabe2/statistic.c b/aufgabe2/statistic.c
index 31230cf..1b6c234 100644
--- a/aufgabe2/statistic.c
+++ b/aufgabe2/statistic.c
@@ -15,6 +15,13 @@ char *message;
void statistic() {
int current_value = 0, last_value = 0, result;
+ /* ungenutzte Pipeköpfe schließen */
+ close(queue[D_CONV_TO_LOG][READ]);
+ close(queue[D_CONV_TO_LOG][WRITE]);
+ close(queue[D_CONV_TO_STAT][WRITE]);
+ close(queue[D_STAT_TO_MON][READ]);
+
+
printf("statistic started\n");
/* Die Pipe zum conv Prozess lesend öffnen, die zum monitor schreibend */