analyze: use static destructors
This commit is contained in:
parent
3be1cabe98
commit
d665c7b2db
|
@ -26,6 +26,7 @@
|
||||||
#include "hashmap.h"
|
#include "hashmap.h"
|
||||||
#include "locale-util.h"
|
#include "locale-util.h"
|
||||||
#include "log.h"
|
#include "log.h"
|
||||||
|
#include "main-func.h"
|
||||||
#include "pager.h"
|
#include "pager.h"
|
||||||
#include "parse-util.h"
|
#include "parse-util.h"
|
||||||
#include "path-util.h"
|
#include "path-util.h"
|
||||||
|
@ -75,6 +76,9 @@ static bool arg_man = true;
|
||||||
static bool arg_generators = false;
|
static bool arg_generators = false;
|
||||||
static const char *arg_root = NULL;
|
static const char *arg_root = NULL;
|
||||||
|
|
||||||
|
STATIC_DESTRUCTOR_REGISTER(arg_dot_from_patterns, strv_freep);
|
||||||
|
STATIC_DESTRUCTOR_REGISTER(arg_dot_to_patterns, strv_freep);
|
||||||
|
|
||||||
struct boot_times {
|
struct boot_times {
|
||||||
usec_t firmware_time;
|
usec_t firmware_time;
|
||||||
usec_t loader_time;
|
usec_t loader_time;
|
||||||
|
@ -1989,7 +1993,7 @@ static int parse_argv(int argc, char *argv[]) {
|
||||||
return 1; /* work to do */
|
return 1; /* work to do */
|
||||||
}
|
}
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
static int run(int argc, char *argv[]) {
|
||||||
|
|
||||||
static const Verb verbs[] = {
|
static const Verb verbs[] = {
|
||||||
{ "help", VERB_ANY, VERB_ANY, 0, help },
|
{ "help", VERB_ANY, VERB_ANY, 0, help },
|
||||||
|
@ -2026,15 +2030,9 @@ int main(int argc, char *argv[]) {
|
||||||
|
|
||||||
r = parse_argv(argc, argv);
|
r = parse_argv(argc, argv);
|
||||||
if (r <= 0)
|
if (r <= 0)
|
||||||
goto finish;
|
return r;
|
||||||
|
|
||||||
r = dispatch_verb(argc, argv, verbs, NULL);
|
return dispatch_verb(argc, argv, verbs, NULL);
|
||||||
|
|
||||||
finish:
|
|
||||||
pager_close();
|
|
||||||
|
|
||||||
strv_free(arg_dot_from_patterns);
|
|
||||||
strv_free(arg_dot_to_patterns);
|
|
||||||
|
|
||||||
return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DEFINE_MAIN_FUNCTION(run);
|
||||||
|
|
Loading…
Reference in a new issue