diff options
Diffstat (limited to 'src/analyze')
-rw-r--r-- | src/analyze/analyze-condition.c | 7 | ||||
-rw-r--r-- | src/analyze/analyze-condition.h | 4 | ||||
-rw-r--r-- | src/analyze/analyze.c | 6 | ||||
-rw-r--r-- | src/analyze/analyze.h | 1 |
4 files changed, 9 insertions, 9 deletions
diff --git a/src/analyze/analyze-condition.c b/src/analyze/analyze-condition.c index e8b0fa978b..0343e69d8f 100644 --- a/src/analyze/analyze-condition.c +++ b/src/analyze/analyze-condition.c @@ -2,6 +2,7 @@ #include <stdlib.h> +#include "analyze.h" #include "analyze-condition.h" #include "analyze-verify-util.h" #include "condition.h" @@ -73,7 +74,7 @@ static int log_helper(void *userdata, int level, int error, const char *file, in return r; } -int verify_conditions(char **lines, UnitFileScope scope, const char *unit, const char *root) { +static int verify_conditions(char **lines, UnitFileScope scope, const char *unit, const char *root) { _cleanup_(manager_freep) Manager *m = NULL; Unit *u; int r, q = 1; @@ -136,3 +137,7 @@ int verify_conditions(char **lines, UnitFileScope scope, const char *unit, const return r > 0 && q > 0 ? 0 : -EIO; } + +int do_condition(int argc, char *argv[], void *userdata) { + return verify_conditions(strv_skip(argv, 1), arg_scope, arg_unit, arg_root); +} diff --git a/src/analyze/analyze-condition.h b/src/analyze/analyze-condition.h index 9ebd205b6d..9cf6204194 100644 --- a/src/analyze/analyze-condition.h +++ b/src/analyze/analyze-condition.h @@ -1,6 +1,4 @@ /* SPDX-License-Identifier: LGPL-2.1-or-later */ #pragma once -#include "install.h" - -int verify_conditions(char **lines, UnitFileScope scope, const char *unit, const char *root); +int do_condition(int argc, char *argv[], void *userdata); diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c index cb4d8c7ca4..1cb981feb6 100644 --- a/src/analyze/analyze.c +++ b/src/analyze/analyze.c @@ -100,7 +100,7 @@ bool arg_offline = false; unsigned arg_threshold = 100; unsigned arg_iterations = 1; usec_t arg_base_time = USEC_INFINITY; -static char *arg_unit = NULL; +char *arg_unit = NULL; JsonFormatFlags arg_json_format_flags = JSON_FORMAT_OFF; bool arg_quiet = false; char *arg_profile = NULL; @@ -163,10 +163,6 @@ void time_parsing_hint(const char *p, bool calendar, bool timestamp, bool timesp "Use 'systemd-analyze timespan \"%s\"' instead?", p); } -static int do_condition(int argc, char *argv[], void *userdata) { - return verify_conditions(strv_skip(argv, 1), arg_scope, arg_unit, arg_root); -} - static int help(int argc, char *argv[], void *userdata) { _cleanup_free_ char *link = NULL, *dot_link = NULL; int r; diff --git a/src/analyze/analyze.h b/src/analyze/analyze.h index 9755f9df36..71a682cdc1 100644 --- a/src/analyze/analyze.h +++ b/src/analyze/analyze.h @@ -32,6 +32,7 @@ extern bool arg_offline; extern unsigned arg_threshold; extern unsigned arg_iterations; extern usec_t arg_base_time; +extern char *arg_unit; extern JsonFormatFlags arg_json_format_flags; extern bool arg_quiet; extern char *arg_profile; |