From 7994d5a2287776e265977ce653e4443ea5156a05 Mon Sep 17 00:00:00 2001 From: Thorsten Töpper Date: Sat, 15 Jan 2011 18:24:58 +0100 Subject: Aufgabe 2&3: kleine Anpassungen im log Code --- aufgabe3/log.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'aufgabe3/log.c') diff --git a/aufgabe3/log.c b/aufgabe3/log.c index 88a394d..9dce2b0 100644 --- a/aufgabe3/log.c +++ b/aufgabe3/log.c @@ -11,20 +11,20 @@ FILE *logfile; char *message; -void logmsg() { +void log() { int random_number = 0; mqd_t log; /* Message Queue zur Kommunikation mit dem conv Prozess öffnen. */ if ((log = mq_open(MQ_TO_LOG, O_RDONLY)) == -1) { - perror("logmsg() mq_open"); + perror("log() mq_open"); exit(EXIT_FAILURE); } /* Logdatei öffnen */ - if ((logfile = fopen("logfile.txt", "w")) == NULL) { - perror("logmsg() fopen"); + if ((logfile = fopen("log.txt", "w")) == NULL) { + perror("log() fopen"); exit(EXIT_FAILURE); } @@ -32,7 +32,7 @@ void logmsg() { * Speicher für Nachricht allokieren. */ if ((message = calloc(1, MQ_MSG_SIZE_RCV)) == NULL) { - perror("logmsg()"); + perror("log()"); exit(EXIT_FAILURE); } @@ -40,7 +40,7 @@ void logmsg() { /* Nachricht über log Queue empfangen */ if (mq_receive(log, message, MQ_MSG_SIZE_RCV, NULL) == -1) { - perror("logmsg() mq_receive"); + perror("log() mq_receive"); exit(EXIT_FAILURE); } @@ -53,7 +53,7 @@ void logmsg() { } } -void logmsg_cleanup() { +void log_cleanup() { printf("log cleanup\n"); free(message); mq_unlink(MQ_TO_LOG); -- cgit v1.2.3-70-g09d2