]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: test-cpu-limit - Remove dead code
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 22 Sep 2021 12:58:55 +0000 (15:58 +0300)
committertimo.sirainen <timo.sirainen@open-xchange.com>
Mon, 27 Sep 2021 12:23:44 +0000 (12:23 +0000)
No longer needed after 6d902507c24fca4f64e3e9bf7d79ae5a48281cd8

src/lib/test-cpu-limit.c

index aefb92ab7d9c3222618a53ae3199709ba966ee67..c4c1090ecc23f4f65a8b4b541a5454b405bf66e2 100644 (file)
@@ -76,7 +76,7 @@ test_cpu_limit_simple(enum cpu_limit_type type, const char *type_str)
 static void test_cpu_limit_nested(enum cpu_limit_type type, const char *type_str)
 {
        struct cpu_limit *climit1, *climit2;
-       struct timeval usage1, usage2, cpu;
+       struct timeval usage1, cpu;
        unsigned int n;
        int diff_msecs;
 
@@ -88,16 +88,11 @@ static void test_cpu_limit_nested(enum cpu_limit_type type, const char *type_str
 
        while (!cpu_limit_exceeded(climit1) && !test_has_failed()) {
                climit2 = cpu_limit_init(1, type);
-               usage2 = get_cpu_time(type);
 
                while (!cpu_limit_exceeded(climit2) && !test_has_failed())
                        test_cpu_loop_once();
 
                cpu_limit_deinit(&climit2);
-               cpu = get_cpu_time(type);
-               /* we may have looped only for a short time in case climit1
-                  was triggered during this loop. */
-               diff_msecs = timeval_diff_msecs(&cpu, &usage2);
        }
 
        cpu_limit_deinit(&climit1);
@@ -122,16 +117,11 @@ static void test_cpu_limit_nested(enum cpu_limit_type type, const char *type_str
                        continue;
                }
                climit2 = cpu_limit_init(1, type);
-               usage2 = get_cpu_time(type);
 
                while (!cpu_limit_exceeded(climit2) && !test_has_failed())
                        test_cpu_loop_once();
 
                cpu_limit_deinit(&climit2);
-               cpu = get_cpu_time(type);
-               /* we may have looped only for a short time in case climit1
-                  was triggered during this loop. */
-               diff_msecs = timeval_diff_msecs(&cpu, &usage2);
        }
 
        cpu_limit_deinit(&climit1);