Long line style fix + comment
[fio.git] / log.c
diff --git a/log.c b/log.c
index 5c468ad9f96c0a708fde126482f01a3bb6a430c3..01e4ad0b37c8fd5e954106bb86079856345ce579 100644 (file)
--- a/log.c
+++ b/log.c
@@ -388,7 +388,7 @@ static int init_iolog_write(struct thread_data *td)
        FILE *f;
        unsigned int i;
 
-       f = fopen(td->o.write_iolog_file, "w+");
+       f = fopen(td->o.write_iolog_file, "a");
        if (!f) {
                perror("fopen write iolog");
                return 1;
@@ -455,7 +455,7 @@ void __finish_log(struct io_log *log, const char *name)
        unsigned int i;
        FILE *f;
 
-       f = fopen(name, "w");
+       f = fopen(name, "a");
        if (!f) {
                perror("fopen log");
                return;
@@ -471,11 +471,17 @@ void __finish_log(struct io_log *log, const char *name)
        free(log);
 }
 
-void finish_log(struct thread_data *td, struct io_log *log, const char *name)
+void finish_log_named(struct thread_data *td, struct io_log *log,
+                      const char *prefix, const char *postfix)
 {
        char file_name[256], *p;
 
-       snprintf(file_name, 200, "%s_%s.log", td->o.name, name);
+       snprintf(file_name, 200, "%s_%s.log", prefix, postfix);
        p = basename(file_name);
        __finish_log(log, p);
 }
+
+void finish_log(struct thread_data *td, struct io_log *log, const char *name)
+{
+       finish_log_named(td, log, td->o.name, name);
+}