From 2bb060a213408f028f6d9381185548c472ff789f Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 20 May 2012 11:23:56 -0500 Subject: [PATCH] Delete staging directory on non-commit unmounts --- src/mount.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/mount.c b/src/mount.c index 844bb34d..7f0def11 100644 --- a/src/mount.c +++ b/src/mount.c @@ -374,9 +374,6 @@ static int rebuild_wim(WIMStruct *w, bool check_integrity) ERROR("Failed to commit changes\n"); return ret; } - ret = delete_staging_dir(); - if (ret != 0) - ERROR("Failed to delete the staging directory: %m\n"); return ret; } @@ -441,11 +438,16 @@ static void wimfs_destroy(void *p) } else { status = 0; } + ret = delete_staging_dir(); + if (ret != 0) { + ERROR("Failed to delete the staging directory: %m\n"); + if (status == 0) + status = ret; + } done: ret = mq_send(daemon_to_unmount_mq, &status, 1, 1); - if (ret == -1) { + if (ret == -1) ERROR("Failed to send status to unmount process: %m\n"); - } close_message_queues(); } -- 2.43.0