]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
analyze: move inspect-elf verb entrypoint into analyze-elf.[ch], too
authorLennart Poettering <lennart@poettering.net>
Mon, 21 Feb 2022 13:09:16 +0000 (14:09 +0100)
committerLennart Poettering <lennart@poettering.net>
Mon, 21 Feb 2022 16:22:23 +0000 (17:22 +0100)
like for the other verbs, let's move the whole entry point for the verb,
too.

src/analyze/analyze-elf.h [deleted file]
src/analyze/analyze-inspect-elf.c [moved from src/analyze/analyze-elf.c with 95% similarity]
src/analyze/analyze-inspect-elf.h [new file with mode: 0644]
src/analyze/analyze.c
src/analyze/meson.build

diff --git a/src/analyze/analyze-elf.h b/src/analyze/analyze-elf.h
deleted file mode 100644 (file)
index e0d4712..0000000
+++ /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);
similarity index 95%
rename from src/analyze/analyze-elf.c
rename to src/analyze/analyze-inspect-elf.c
index 741cd20f9985b7d350fc1358d7bbf1184e30ed9d..966c2eff936bcf0fadc80fa34b43ac7ad42be2ab 100644 (file)
@@ -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 (file)
index 0000000..fa8e1b7
--- /dev/null
@@ -0,0 +1,4 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+int do_elf_inspection(int argc, char *argv[], void *userdata);
index b2aaf65338ca09a380d7e4f9544aa24f356be2f6..68cda2b5ea7822d482a662bead18c378071df1ac 100644 (file)
@@ -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;
index 00e1bfe4ca560f17d8860d332c3bf32409ee3f82..83b244c80c2e04cc67b274e422e3bc469156bd27 100644 (file)
@@ -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