summaryrefslogtreecommitdiffstats
path: root/src/analyze
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-02-21 14:09:16 +0100
committerLennart Poettering <lennart@poettering.net>2022-02-21 17:22:23 +0100
commit2acfc25225323b843fc585c4ffea4d98928b6485 (patch)
treebaff3408bb632189fd821799684fc4e928f03f98 /src/analyze
parentanalyze: fully move "security" verb to analyze-security.[ch] (diff)
downloadsystemd-2acfc25225323b843fc585c4ffea4d98928b6485.tar.xz
systemd-2acfc25225323b843fc585c4ffea4d98928b6485.zip
analyze: move inspect-elf verb entrypoint into analyze-elf.[ch], too
like for the other verbs, let's move the whole entry point for the verb, too.
Diffstat (limited to 'src/analyze')
-rw-r--r--src/analyze/analyze-elf.h6
-rw-r--r--src/analyze/analyze-inspect-elf.c (renamed from src/analyze/analyze-elf.c)11
-rw-r--r--src/analyze/analyze-inspect-elf.h4
-rw-r--r--src/analyze/analyze.c8
-rw-r--r--src/analyze/meson.build4
5 files changed, 16 insertions, 17 deletions
diff --git a/src/analyze/analyze-elf.h b/src/analyze/analyze-elf.h
deleted file mode 100644
index e0d4712e5a..0000000000
--- a/src/analyze/analyze-elf.h
+++ /dev/null
@@ -1,6 +0,0 @@
-/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#pragma once
-
-#include "json.h"
-
-int analyze_elf(char **filenames, JsonFormatFlags json_flags);
diff --git a/src/analyze/analyze-elf.c b/src/analyze/analyze-inspect-elf.c
index 741cd20f99..966c2eff93 100644
--- a/src/analyze/analyze-elf.c
+++ b/src/analyze/analyze-inspect-elf.c
@@ -1,6 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
-#include "analyze-elf.h"
+#include "analyze.h"
+#include "analyze-inspect-elf.h"
#include "elf-util.h"
#include "errno-util.h"
#include "fd-util.h"
@@ -10,7 +11,7 @@
#include "path-util.h"
#include "strv.h"
-int analyze_elf(char **filenames, JsonFormatFlags json_flags) {
+static int analyze_elf(char **filenames, JsonFormatFlags json_flags) {
char **filename;
int r;
@@ -126,3 +127,9 @@ int analyze_elf(char **filenames, JsonFormatFlags json_flags) {
return 0;
}
+
+int do_elf_inspection(int argc, char *argv[], void *userdata) {
+ pager_open(arg_pager_flags);
+
+ return analyze_elf(strv_skip(argv, 1), arg_json_format_flags);
+}
diff --git a/src/analyze/analyze-inspect-elf.h b/src/analyze/analyze-inspect-elf.h
new file mode 100644
index 0000000000..fa8e1b7ee9
--- /dev/null
+++ b/src/analyze/analyze-inspect-elf.h
@@ -0,0 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+int do_elf_inspection(int argc, char *argv[], void *userdata);
diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c
index b2aaf65338..68cda2b5ea 100644
--- a/src/analyze/analyze.c
+++ b/src/analyze/analyze.c
@@ -21,9 +21,9 @@
#include "analyze-critical-chain.h"
#include "analyze-dot.h"
#include "analyze-dump.h"
-#include "analyze-elf.h"
#include "analyze-exit-status.h"
#include "analyze-filesystems.h"
+#include "analyze-inspect-elf.h"
#include "analyze-log-control.h"
#include "analyze-plot.h"
#include "analyze-security.h"
@@ -230,12 +230,6 @@ static int do_verify(int argc, char *argv[], void *userdata) {
return verify_units(filenames, arg_scope, arg_man, arg_generators, arg_recursive_errors, arg_root);
}
-static int do_elf_inspection(int argc, char *argv[], void *userdata) {
- pager_open(arg_pager_flags);
-
- return analyze_elf(strv_skip(argv, 1), arg_json_format_flags);
-}
-
static int help(int argc, char *argv[], void *userdata) {
_cleanup_free_ char *link = NULL, *dot_link = NULL;
int r;
diff --git a/src/analyze/meson.build b/src/analyze/meson.build
index 00e1bfe4ca..83b244c80c 100644
--- a/src/analyze/meson.build
+++ b/src/analyze/meson.build
@@ -17,12 +17,12 @@ systemd_analyze_sources = files('''
analyze-dot.h
analyze-dump.c
analyze-dump.h
- analyze-elf.c
- analyze-elf.h
analyze-exit-status.c
analyze-exit-status.h
analyze-filesystems.c
analyze-filesystems.h
+ analyze-inspect-elf.c
+ analyze-inspect-elf.h
analyze-log-control.c
analyze-log-control.h
analyze-plot.c