Skip to content

Commit b2e15e3

Browse files
committed
🚧 gucc: handle btrfs subvol mount status
1 parent a31d1fc commit b2e15e3

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

‎gucc/src/btrfs.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,15 @@ auto btrfs_mount_subvols(const std::vector<BtrfsSubvolume>& subvols, std::string
7878
spdlog::error("Failed to create directories for btrfs subvols mountpoint {}: {}", subvolume_mountpoint, err.message());
7979
return false;
8080
}
81-
// TODO(vnepogodin): handle exit code
82-
utils::exec(fmt::format(FMT_COMPILE("mount -o {} \"{}\" {}"), mount_option, device, subvolume_mountpoint));
81+
82+
// now mount subvolume
83+
const auto& mount_cmd = fmt::format(FMT_COMPILE("mount -o {} \"{}\" {}"), mount_option, device, subvolume_mountpoint);
84+
85+
spdlog::debug("mounting..: {}", mount_cmd);
86+
if (!utils::exec_checked(mount_cmd)) {
87+
spdlog::error("Failed to mount subvolume {} mountpoint {} with: {}", subvol.subvolume, subvolume_mountpoint, mount_cmd);
88+
return false;
89+
}
8390
}
8491
return true;
8592
}

0 commit comments

Comments
 (0)