From bacc04bedca30a4f84baebe71a20a3461e66c4ee Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Tue, 12 Nov 2024 09:45:05 +0100 Subject: [PATCH] dissect: minor simplifications --- src/dissect/dissect.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/dissect/dissect.c b/src/dissect/dissect.c index 7709f42c488..91f0f1de136 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) { -- 2.47.3