aboutsummaryrefslogtreecommitdiff
path: root/aufgabe2/conv.c
diff options
context:
space:
mode:
authorThorsten Töpper <atsutane@freethoughts.de>2011-01-10 20:45:59 +0100
committerThorsten Töpper <atsutane@freethoughts.de>2011-01-10 20:45:59 +0100
commit24ce486813103f5f8037b4386a53fa11d1632253 (patch)
tree2247aa3f62507f7faee4f64ca49bed51d6895b31 /aufgabe2/conv.c
parent7d28c089b45d465b18df1c5cda72abed3748118f (diff)
downloadprozesskommunikation-24ce486813103f5f8037b4386a53fa11d1632253.tar.gz
prozesskommunikation-24ce486813103f5f8037b4386a53fa11d1632253.tar.bz2
Aufgabe 2: statistic implementiert, kleinere Schönheitskorrekturen.
Diffstat (limited to 'aufgabe2/conv.c')
-rw-r--r--aufgabe2/conv.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/aufgabe2/conv.c b/aufgabe2/conv.c
index a28f120..1c2e1b5 100644
--- a/aufgabe2/conv.c
+++ b/aufgabe2/conv.c
@@ -5,7 +5,6 @@
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
-#include <limits.h>
#include "queue.h"
@@ -15,6 +14,8 @@ FILE *pipe_stat;
void conv() {
int random_number = 0;
+ printf("conv started\n");
+
/* Die beiden Pipes zum schreiben öffnen */
if (((pipe_log = fdopen(queue[D_CONV_TO_LOG][WRITE], "w")) == NULL) ||
((pipe_stat = fdopen(queue[D_CONV_TO_STAT][WRITE], "w")) == NULL)) {
@@ -23,11 +24,8 @@ void conv() {
}
for (;;) {
- /* Generierung der Zufallszahl, um Fehler im
- * statistic Prozess zu vermeiden mit geringerem
- * Wertebereich [0, SHRT_MAX] (quasi als short).
- */
- random_number = rand()%SHRT_MAX;
+ /* Generierung der Zufallszahl */
+ random_number = rand();
/* Nachricht sowohl in die Queue zum log Prozess als auch
* in die Queue zum statistic Prozess schreiben.