]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
report: fix hang when we start skipping metrics
authorZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Wed, 11 Feb 2026 11:44:13 +0000 (12:44 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@amutable.com>
Wed, 11 Feb 2026 11:47:02 +0000 (12:47 +0100)
Fixup for 0ec663a41fc49a3e4ec592c4e0037f4bc7e8f6fc.

src/report/report.c

index 62affd0a7cb4730578bccadabbe16f6bcc2fbffb..fad7fdf363dbfbc914cde94f514b4789bb24d6bf 100644 (file)
@@ -85,12 +85,9 @@ static int metrics_on_query_reply(
                         log_info("Varlink timed out");
                 else
                         log_error("Varlink error: %s", error_id);
-        } else {
-                if (context->n_metrics >= METRICS_MAX) {
-                        context->n_skipped_metrics++;
-                        return 0;
-                }
-
+        } else if (context->n_metrics >= METRICS_MAX)
+                context->n_skipped_metrics++;
+        else {
                 /* Collect metrics for later sorting */
                 if (!GREEDY_REALLOC(context->metrics, context->n_metrics + 1))
                         return log_oom();