aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--aufgabe2/log.c2
-rw-r--r--aufgabe3/log.c14
-rw-r--r--aufgabe3/log.h4
-rw-r--r--aufgabe3/main.c2
4 files changed, 11 insertions, 11 deletions
diff --git a/aufgabe2/log.c b/aufgabe2/log.c
index 779b25b..62adeaf 100644
--- a/aufgabe2/log.c
+++ b/aufgabe2/log.c
@@ -30,7 +30,7 @@ void log() {
}
/* Logdatei öffnen */
- if ((logfile = fopen("logfile.txt", "w")) == NULL) {
+ if ((logfile = fopen("log.txt", "w")) == NULL) {
perror("log.c fopen()");
exit(EXIT_FAILURE);
}
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);
diff --git a/aufgabe3/log.h b/aufgabe3/log.h
index 1d046f8..e6b171f 100644
--- a/aufgabe3/log.h
+++ b/aufgabe3/log.h
@@ -1,7 +1,7 @@
#ifndef _LOG_H
#define _LOG_H
-void logmsg();
-void logmsg_cleanup();
+void log();
+void log_cleanup();
#endif
diff --git a/aufgabe3/main.c b/aufgabe3/main.c
index 12b61fa..c0ec8b3 100644
--- a/aufgabe3/main.c
+++ b/aufgabe3/main.c
@@ -112,7 +112,7 @@ int main() {
mqueue_init(MQ_TO_MONITOR);
pconv = fork_child(conv, conv_cleanup);
- plog = fork_child(logmsg, logmsg_cleanup);
+ plog = fork_child(log, log_cleanup);
pstatistic = fork_child(statistic, statistic_cleanup);
pmonitor = fork_child(monitor, monitor_cleanup);