return tmp_subsession_path;
}
+static void umount_and_remove (const fs::path& path) try {
+ do_umount(path);
+ fs::remove(path);
+} catch (const std::exception& ex) {
+ LOGE("umount & rmdir (%s) failed!", path.c_str());
+ throw;
+}
+
void DirBackendAddFixedSize::AddSubsessionCleanupFailure (const fs::path& tmpdir_path, const fs::path& subsession_path) const
{
auto tmp_image_path = DirBackendFixedSize::GetImagePathFromSubsessionPath(subsession_path);
tmp_image_path.replace_filename(TMP_NEW_PREFIX + tmp_image_path.filename().native());
- fs::remove(tmpdir_path);
fs::remove(tmp_image_path);
+ umount_and_remove(tmpdir_path);
}
void DirBackendAddFixedSize::AddSubsessionFinalize (const fs::path& tmpdir_path, const fs::path& subsession_path, int uid, int gid) const
{
- try {
- do_umount(tmpdir_path);
- fs::remove(tmpdir_path);
- } catch (const std::exception& ex) {
- LOGE("umount & rmdir (%s) failed!", tmpdir_path.c_str());
- throw;
- }
+ umount_and_remove(tmpdir_path);
const auto image_path = DirBackendFixedSize::GetImagePathFromSubsessionPath(subsession_path);
auto temp_image_path = image_path;