From 3cb26812c09a0533f593323f1f4912dfd6aba9dd Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 6 Dec 2010 21:45:30 +0100 Subject: bugfix: wait() statt waitpid() nutzen, damit die reihenfolge egal ist, in welcher die prozesse zurückkehren MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- aufgabe4/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'aufgabe4') diff --git a/aufgabe4/main.c b/aufgabe4/main.c index 7c86bb3..3f6edec 100644 --- a/aufgabe4/main.c +++ b/aufgabe4/main.c @@ -84,11 +84,11 @@ int main() { signal(SIGTERM, sigterm); + /* Warten, bis 4 Prozesse (Reihenfolge egal) sich beendet haben. */ int status; - waitpid(pconv, &status, 0); - waitpid(plog, &status, 0); - waitpid(pstatistic, &status, 0); - waitpid(pmonitor, &status, 0); + int c; + for (c = 0; c < 4; c++) + wait(&status); return 0; } -- cgit v1.2.3-70-g09d2