]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: test-event-log - Use the new test-dir API
authorStephan Bosch <stephan.bosch@open-xchange.com>
Mon, 27 Oct 2025 22:58:34 +0000 (23:58 +0100)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Wed, 5 Nov 2025 10:17:48 +0000 (10:17 +0000)
src/lib/test-event-log.c

index 5a2e2b387e32d5ceb12e648c7025e87ad85adfe0..3bbf82c8a15701d8df8c2a356d913afe8ad3190b 100644 (file)
@@ -45,7 +45,7 @@ struct test_log {
        enum test_log_flag flags;
 };
 
-static const char *temp_log_file = ".temp.log_file";
+static char *temp_log_file = NULL;
 
 static const char *
 test_event_log_prefix_cb(char *prefix)
@@ -63,6 +63,7 @@ test_event_log_message_cb(char *prefix,
 
 static int temp_log_file_init(void)
 {
+       temp_log_file = i_strconcat(test_dir_get_prefix(), "event.log", NULL);
        int log_fd = open(temp_log_file, O_CREAT | O_TRUNC | O_RDWR, 0600);
        if (log_fd == -1)
                i_fatal("open(%s) failed: %m", temp_log_file);
@@ -2518,4 +2519,5 @@ void test_event_log(void)
        i_set_error_handler(orig_error);
        i_close_fd(&log_fd);
        i_unlink(temp_log_file);
+       i_free(temp_log_file);
 }