summaryrefslogtreecommitdiffstats
path: root/src/dissect
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2024-11-12 09:45:05 +0100
committerDaan De Meyer <daan.j.demeyer@gmail.com>2025-01-03 16:43:43 +0100
commitbacc04bedca30a4f84baebe71a20a3461e66c4ee (patch)
tree32c10e8ab9a38186f506be20a173495040296969 /src/dissect
parentsd-json: add json_dispatch_const_path() helper (diff)
downloadsystemd-bacc04bedca30a4f84baebe71a20a3461e66c4ee.tar.xz
systemd-bacc04bedca30a4f84baebe71a20a3461e66c4ee.zip
dissect: minor simplifications
Diffstat (limited to 'src/dissect')
-rw-r--r--src/dissect/dissect.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c
index 7709f42c48..91f0f1de13 100644
--- a/src/dissect/dissect.c
+++ b/src/dissect/dissect.c
@@ -1472,7 +1472,7 @@ static int action_list_or_mtree_or_copy_or_make_archive(DissectedImage *m, LoopD
if (r < 0)
return r;
- mounted_dir = TAKE_PTR(t);
+ root = mounted_dir = TAKE_PTR(t);
if (d) {
r = loop_device_flock(d, LOCK_UN);
@@ -1483,11 +1483,10 @@ static int action_list_or_mtree_or_copy_or_make_archive(DissectedImage *m, LoopD
r = dissected_image_relinquish(m);
if (r < 0)
return log_error_errno(r, "Failed to relinquish DM and loopback block devices: %m");
- }
-
- root = mounted_dir ?: arg_root;
- dissected_image_close(m);
+ dissected_image_close(m);
+ } else
+ root = arg_root;
switch (arg_action) {