From b2e15e3f069e39d16cf212181182847787637458 Mon Sep 17 00:00:00 2001 From: Vladislav Nepogodin Date: Wed, 24 Jul 2024 00:12:18 +0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A7=20gucc:=20handle=20btrfs=20subvol?= =?UTF-8?q?=20mount=20status?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gucc/src/btrfs.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gucc/src/btrfs.cpp b/gucc/src/btrfs.cpp index 0a40758..b8e5168 100644 --- a/gucc/src/btrfs.cpp +++ b/gucc/src/btrfs.cpp @@ -78,8 +78,15 @@ auto btrfs_mount_subvols(const std::vector& subvols, std::string spdlog::error("Failed to create directories for btrfs subvols mountpoint {}: {}", subvolume_mountpoint, err.message()); return false; } - // TODO(vnepogodin): handle exit code - utils::exec(fmt::format(FMT_COMPILE("mount -o {} \"{}\" {}"), mount_option, device, subvolume_mountpoint)); + + // now mount subvolume + const auto& mount_cmd = fmt::format(FMT_COMPILE("mount -o {} \"{}\" {}"), mount_option, device, subvolume_mountpoint); + + spdlog::debug("mounting..: {}", mount_cmd); + if (!utils::exec_checked(mount_cmd)) { + spdlog::error("Failed to mount subvolume {} mountpoint {} with: {}", subvol.subvolume, subvolume_mountpoint, mount_cmd); + return false; + } } return true; }