From c70cce73680ff9d5e19edc0a20df46f9e4e623bf Mon Sep 17 00:00:00 2001 From: Matthew Johnson Date: Wed, 9 Aug 2017 10:48:57 -0700 Subject: [PATCH] Exit early when listing installable bundles It is not necessary to go through the whole swupd initiation process a second time when listing bundles from the server. This also allows us to set the correct exit status on the early exit. Signed-off-by: Matthew Johnson --- src/clr_bundle_ls.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/clr_bundle_ls.c b/src/clr_bundle_ls.c index 69005f45..c68782fc 100644 --- a/src/clr_bundle_ls.c +++ b/src/clr_bundle_ls.c @@ -75,7 +75,10 @@ static bool parse_options(int argc, char **argv) print_help(argv[0]); exit(EXIT_SUCCESS); case 'a': - return list_installable_bundles(); + /* Exit early, we do not need to init swupd locally just to get a + * list from the server + * list_installable_bundles will supply the exit status */ + exit(list_installable_bundles()); break; case 'u': if (!optarg) {