summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--image/backends/iso.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/image/backends/iso.cc b/image/backends/iso.cc
index 00f5ae4..18dc23e 100644
--- a/image/backends/iso.cc
+++ b/image/backends/iso.cc
@@ -203,8 +203,12 @@ public:
*/
for(const std::string mount : {"dev", "proc", "sys"}) {
const std::string path = this->ir_dir + "/target/" + mount;
- if(::umount(path.c_str()) == EBUSY) {
- run_command("umount", {"-R", path});
+ if(::umount(path.c_str()) == -1) {
+ if(errno == EBUSY &&
+ run_command("umount", {"-R", path}) != 0) {
+ output_error("CD backend", "could not umount " + path);
+ return FS_ERROR;
+ }
}
}
fs::remove_all(this->ir_dir, ec);