From: Eric Biggers Date: Sun, 20 May 2012 16:23:56 +0000 (-0500) Subject: Delete staging directory on non-commit unmounts X-Git-Tag: v0.7.1~4 X-Git-Url: https://wimlib.net/git/?p=wimlib;a=commitdiff_plain;h=2bb060a213408f028f6d9381185548c472ff789f Delete staging directory on non-commit unmounts --- 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(); }