]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master: test-event-stats: Move launch_test_stats() to a more logical place.
authorStephan Bosch <stephan.bosch@dovecot.fi>
Thu, 18 Oct 2018 13:09:51 +0000 (15:09 +0200)
committerStephan Bosch <stephan.bosch@dovecot.fi>
Thu, 18 Oct 2018 13:40:01 +0000 (15:40 +0200)
src/lib-master/test-event-stats.c

index 35a1f61bfb8d189a95e8bfe699648156999504b1..05e21e233c0bf5660b645b9081894fab883cb54b 100644 (file)
@@ -223,23 +223,6 @@ static void signal_process(const char *signal_file)
        i_close_fd(&fd);
 }
 
-static int launch_test_stats(void)
-{
-       /* Make sure files are not existing */
-       i_unlink_if_exists(test_done);
-       i_unlink_if_exists(exit_stats);
-       i_unlink_if_exists(stats_ready);
-
-       if ((stats_pid = fork()) == (pid_t)-1)
-               i_fatal("fork() failed: %m");
-       if (stats_pid == 0) {
-               stats_proc();
-               return 0;
-       }
-       wait_for_signal(stats_ready);
-       return run_tests();
-}
-
 static bool compare_test_stats_data_line(const char *reference, const char *actual)
 {
        const char *const *ref_args = t_strsplit(reference, "\t");
@@ -564,6 +547,23 @@ static int run_tests(void)
        return ret;
 }
 
+static int launch_test_stats(void)
+{
+       /* Make sure files are not existing */
+       i_unlink_if_exists(test_done);
+       i_unlink_if_exists(exit_stats);
+       i_unlink_if_exists(stats_ready);
+
+       if ((stats_pid = fork()) == (pid_t)-1)
+               i_fatal("fork() failed: %m");
+       if (stats_pid == 0) {
+               stats_proc();
+               return 0;
+       }
+       wait_for_signal(stats_ready);
+       return run_tests();
+}
+
 int main(void)
 {
        int ret;