diff options
| author | Thorsten Töpper <atsutane@freethoughts.de> | 2011-01-15 18:24:58 +0100 |
|---|---|---|
| committer | Thorsten Töpper <atsutane@freethoughts.de> | 2011-01-15 18:24:58 +0100 |
| commit | 7994d5a2287776e265977ce653e4443ea5156a05 (patch) | |
| tree | 523864d8a555587facc19365c2ef0fa4b0271f1a /aufgabe3/log.c | |
| parent | b7b4c5a98c47464ca54ff2aff3fda9e3c3944c14 (diff) | |
| download | prozesskommunikation-7994d5a2287776e265977ce653e4443ea5156a05.tar.gz prozesskommunikation-7994d5a2287776e265977ce653e4443ea5156a05.tar.bz2 | |
Aufgabe 2&3: kleine Anpassungen im log Code
Diffstat (limited to 'aufgabe3/log.c')
| -rw-r--r-- | aufgabe3/log.c | 14 |
1 files changed, 7 insertions, 7 deletions
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); |
