summaryrefslogtreecommitdiff
path: root/src/ostree/ot-admin-builtin-unlock.c
diff options
context:
space:
mode:
authorColin Walters <walters@verbum.org>2021-03-17 14:03:49 +0000
committerColin Walters <walters@verbum.org>2021-03-17 19:55:56 +0000
commit1b28e6041c33b3f1508dda458ed7ed97aed4375e (patch)
treed9e3f69b61865bc037d97c1ea22d54fd3a72f786 /src/ostree/ot-admin-builtin-unlock.c
parentd522f261db7e4c2379fe79a18c083426858fc355 (diff)
downloadostree-1b28e6041c33b3f1508dda458ed7ed97aed4375e.tar.gz
sysroot: Add _require_booted_deployment() API
This is a common pattern that is replicated both in our code and in rpm-ostree a lot. Let's add a canonical API.
Diffstat (limited to 'src/ostree/ot-admin-builtin-unlock.c')
-rw-r--r--src/ostree/ot-admin-builtin-unlock.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/ostree/ot-admin-builtin-unlock.c b/src/ostree/ot-admin-builtin-unlock.c
index 6c265f54..77fe8be3 100644
--- a/src/ostree/ot-admin-builtin-unlock.c
+++ b/src/ostree/ot-admin-builtin-unlock.c
@@ -61,13 +61,9 @@ ot_admin_builtin_unlock (int argc, char **argv, OstreeCommandInvocation *invocat
goto out;
}
- booted_deployment = ostree_sysroot_get_booted_deployment (sysroot);
+ booted_deployment = ostree_sysroot_require_booted_deployment (sysroot, error);
if (!booted_deployment)
- {
- g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_FAILED,
- "Not currently booted into an OSTree system");
- goto out;
- }
+ goto out;
if (opt_hotfix && opt_transient)
{