diff options
author | Lennart Poettering <lennart@poettering.net> | 2021-10-26 17:36:36 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2021-10-28 08:17:46 +0200 |
commit | 32dda527d838d375473456fc757b8e377c07ef38 (patch) | |
tree | bc817e4ce2304282e4005976f8cfef2bbe02d027 /src/home/homework.c | |
parent | homework: get rid of manual clean up path in home_setup_luks() (diff) | |
download | systemd-32dda527d838d375473456fc757b8e377c07ef38.tar.xz systemd-32dda527d838d375473456fc757b8e377c07ef38.zip |
homework: move destruction of temporary image file into HomeSetup
Let's simplify things further a bit and move the destruction of the
temporary image file we operate on when creating a LUKS home into
HomeSetup, like all our other resources.
Diffstat (limited to 'src/home/homework.c')
-rw-r--r-- | src/home/homework.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/home/homework.c b/src/home/homework.c index 22a960efd5..7a2d816e59 100644 --- a/src/home/homework.c +++ b/src/home/homework.c @@ -382,6 +382,14 @@ int home_setup_done(HomeSetup *setup) { setup->image_fd = safe_close(setup->image_fd); } + if (setup->temporary_image_path) { + if (unlink(setup->temporary_image_path) < 0) + log_debug_errno(errno, "Failed to remove temporary image file '%s', ignoring: %m", + setup->temporary_image_path); + + setup->temporary_image_path = mfree(setup->temporary_image_path); + } + setup->undo_mount = false; setup->undo_dm = false; setup->do_offline_fitrim = false; |