File tree Expand file tree Collapse file tree 1 file changed +8
-12
lines changed
Expand file tree Collapse file tree 1 file changed +8
-12
lines changed Original file line number Diff line number Diff line change 1818#include "json.h"
1919#include "locale-util.h"
2020#include "log.h"
21+ #include "main-func.h"
2122#include "pager.h"
2223#include "parse-util.h"
2324#include "path-util.h"
@@ -55,6 +56,8 @@ static bool arg_augment_creds = true;
5556static bool arg_watch_bind = false;
5657static usec_t arg_timeout = 0 ;
5758
59+ STATIC_DESTRUCTOR_REGISTER (arg_matches , strv_freep );
60+
5861#define NAME_IS_ACQUIRED INT_TO_PTR(1)
5962#define NAME_IS_ACTIVATABLE INT_TO_PTR(2)
6063
@@ -2417,24 +2420,17 @@ static int busctl_main(int argc, char *argv[]) {
24172420 return dispatch_verb (argc , argv , verbs , NULL );
24182421}
24192422
2420- int main (int argc , char * argv []) {
2423+ static int run (int argc , char * argv []) {
24212424 int r ;
24222425
24232426 log_parse_environment ();
24242427 log_open ();
24252428
24262429 r = parse_argv (argc , argv );
24272430 if (r <= 0 )
2428- goto finish ;
2429-
2430- r = busctl_main (argc , argv );
2431-
2432- finish :
2433- /* make sure we terminate the bus connection first, and then close the
2434- * pager, see issue #3543 for the details. */
2435- pager_close ();
2436-
2437- arg_matches = strv_free (arg_matches );
2431+ return r ;
24382432
2439- return r < 0 ? EXIT_FAILURE : EXIT_SUCCESS ;
2433+ return busctl_main ( argc , argv ) ;
24402434}
2435+
2436+ DEFINE_MAIN_FUNCTION (run );
You can’t perform that action at this time.
0 commit comments