summaryrefslogtreecommitdiff
path: root/src/ostree/ot-admin-builtin-unlock.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2022-06-14 09:50:07 -0400
committerColin Walters <walters@verbum.org>2022-06-14 09:53:11 -0400
commit4e356d0e8fde00ec8b283f0ec946fcdd1b833aa6 (patch)
treec1ac5f865eeb0364486255ab22aafd569ff1580e /src/ostree/ot-admin-builtin-unlock.c
parent588b07e5542106eb3baef046f7858b9c6f56736f (diff)
downloadostree-4e356d0e8fde00ec8b283f0ec946fcdd1b833aa6.tar.gz
cli/unlock: Port to C99 style
General background cleanup.
Diffstat (limited to 'src/ostree/ot-admin-builtin-unlock.c')
-rw-r--r--src/ostree/ot-admin-builtin-unlock.c29
1 files changed, 11 insertions, 18 deletions
diff --git a/src/ostree/ot-admin-builtin-unlock.c b/src/ostree/ot-admin-builtin-unlock.c
index 800c0744..f438a13e 100644
--- a/src/ostree/ot-admin-builtin-unlock.c
+++ b/src/ostree/ot-admin-builtin-unlock.c
@@ -40,33 +40,28 @@ static GOptionEntry options[] = {
gboolean
ot_admin_builtin_unlock (int argc, char **argv, OstreeCommandInvocation *invocation, GCancellable *cancellable, GError **error)
{
- gboolean ret = FALSE;
- g_autoptr(GOptionContext) context = NULL;
- g_autoptr(OstreeSysroot) sysroot = NULL;
- OstreeDeployment *booted_deployment = NULL;
- OstreeDeploymentUnlockedState target_state;
-
- context = g_option_context_new ("");
+ g_autoptr(GOptionContext) context = g_option_context_new ("");
+ g_autoptr(OstreeSysroot) sysroot = NULL;
if (!ostree_admin_option_context_parse (context, options, &argc, &argv,
OSTREE_ADMIN_BUILTIN_FLAG_SUPERUSER,
invocation, &sysroot, cancellable, error))
- goto out;
+ return FALSE;
if (argc > 1)
{
ot_util_usage_error (context, "This command takes no extra arguments", error);
- goto out;
+ return FALSE;
}
- booted_deployment = ostree_sysroot_require_booted_deployment (sysroot, error);
+ OstreeDeployment *booted_deployment = ostree_sysroot_require_booted_deployment (sysroot, error);
if (!booted_deployment)
- goto out;
+ return FALSE;
+ OstreeDeploymentUnlockedState target_state;
if (opt_hotfix && opt_transient)
{
- glnx_throw (error, "Cannot specify both --hotfix and --transient");
- goto out;
+ return glnx_throw (error, "Cannot specify both --hotfix and --transient");
}
else if (opt_hotfix)
target_state = OSTREE_DEPLOYMENT_UNLOCKED_HOTFIX;
@@ -77,8 +72,8 @@ ot_admin_builtin_unlock (int argc, char **argv, OstreeCommandInvocation *invocat
if (!ostree_sysroot_deployment_unlock (sysroot, booted_deployment,
target_state, cancellable, error))
- goto out;
-
+ return FALSE;
+
switch (target_state)
{
case OSTREE_DEPLOYMENT_UNLOCKED_NONE:
@@ -99,7 +94,5 @@ ot_admin_builtin_unlock (int argc, char **argv, OstreeCommandInvocation *invocat
break;
}
- ret = TRUE;
- out:
- return ret;
+ return TRUE;
}