From 7c8480fe375c0423a2ba83b7d5cd7623a32adf3f Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Fri, 21 Aug 2026 07:16:46 +0900 Subject: [PATCH] coredumpctl: extern several global variables --- src/coredump/coredumpctl.c | 34 ++++++++++++++++++---------------- src/coredump/coredumpctl.h | 21 +++++++++++++++++++++ 2 files changed, 39 insertions(+), 16 deletions(-) create mode 100644 src/coredump/coredumpctl.h diff --git a/src/coredump/coredumpctl.c b/src/coredump/coredumpctl.c index 350479e8df..e312c54c90 100644 --- a/src/coredump/coredumpctl.c +++ b/src/coredump/coredumpctl.c @@ -20,6 +20,7 @@ #include "bus-util.h" #include "chase.h" #include "compress.h" +#include "coredumpctl.h" #include "dissect-image.h" #include "dlopen-note.h" #include "errno-util.h" @@ -57,28 +58,29 @@ #define SHORT_BUS_CALL_TIMEOUT_USEC (3 * USEC_PER_SEC) -static usec_t arg_since = USEC_INFINITY, arg_until = USEC_INFINITY; -static const char* arg_field = NULL; -static const char *arg_debugger = NULL; -static char **arg_debugger_args = NULL; -static const char *arg_directory = NULL; -static char *arg_root = NULL; +usec_t arg_since = USEC_INFINITY; +usec_t arg_until = USEC_INFINITY; +const char *arg_field = NULL; +const char *arg_debugger = NULL; +char **arg_debugger_args = NULL; +const char *arg_directory = NULL; +char **arg_file = NULL; +sd_json_format_flags_t arg_json_format_flags = SD_JSON_FORMAT_OFF; +PagerFlags arg_pager_flags = 0; +int arg_legend = true; +size_t arg_rows_max = SIZE_MAX; +const char *arg_output = NULL; +bool arg_reverse = false; +bool arg_quiet = false; +bool arg_all = false; +char *arg_root = NULL; static char *arg_image = NULL; -static char **arg_file = NULL; -static sd_json_format_flags_t arg_json_format_flags = SD_JSON_FORMAT_OFF; -static PagerFlags arg_pager_flags = 0; -static int arg_legend = true; -static size_t arg_rows_max = SIZE_MAX; -static const char* arg_output = NULL; -static bool arg_reverse = false; -static bool arg_quiet = false; -static bool arg_all = false; static ImagePolicy *arg_image_policy = NULL; STATIC_DESTRUCTOR_REGISTER(arg_debugger_args, strv_freep); +STATIC_DESTRUCTOR_REGISTER(arg_file, strv_freep); STATIC_DESTRUCTOR_REGISTER(arg_root, freep); STATIC_DESTRUCTOR_REGISTER(arg_image, freep); -STATIC_DESTRUCTOR_REGISTER(arg_file, strv_freep); STATIC_DESTRUCTOR_REGISTER(arg_image_policy, image_policy_freep); COMMAND( diff --git a/src/coredump/coredumpctl.h b/src/coredump/coredumpctl.h new file mode 100644 index 0000000000..2827901cea --- /dev/null +++ b/src/coredump/coredumpctl.h @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +#pragma once + +#include "forward.h" + +extern usec_t arg_since; +extern usec_t arg_until; +extern const char *arg_field; +extern const char *arg_debugger; +extern char **arg_debugger_args; +extern const char *arg_directory; +extern char **arg_file; +extern sd_json_format_flags_t arg_json_format_flags; +extern PagerFlags arg_pager_flags; +extern int arg_legend; +extern size_t arg_rows_max; +extern const char *arg_output; +extern bool arg_reverse; +extern bool arg_quiet; +extern bool arg_all; +extern char *arg_root;