summaryrefslogtreecommitdiffstats
path: root/install/fuse_install.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2019-07-10 22:41:30 +0200
committerandroid-build-merger <android-build-merger@google.com>2019-07-10 22:41:30 +0200
commit0c666e3d5db5a9a76829b9fc60c7a97e755f0db9 (patch)
tree15e028fddab0693f79f8ac7c789a5fc642a2c3b9 /install/fuse_install.cpp
parentMerge "Change the symlink to system_ext" (diff)
parentMerge "Create a fallback to install from fuse if mmap fails" (diff)
downloadandroid_bootable_recovery-0c666e3d5db5a9a76829b9fc60c7a97e755f0db9.tar
android_bootable_recovery-0c666e3d5db5a9a76829b9fc60c7a97e755f0db9.tar.gz
android_bootable_recovery-0c666e3d5db5a9a76829b9fc60c7a97e755f0db9.tar.bz2
android_bootable_recovery-0c666e3d5db5a9a76829b9fc60c7a97e755f0db9.tar.lz
android_bootable_recovery-0c666e3d5db5a9a76829b9fc60c7a97e755f0db9.tar.xz
android_bootable_recovery-0c666e3d5db5a9a76829b9fc60c7a97e755f0db9.tar.zst
android_bootable_recovery-0c666e3d5db5a9a76829b9fc60c7a97e755f0db9.zip
Diffstat (limited to 'install/fuse_install.cpp')
-rw-r--r--install/fuse_install.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/install/fuse_install.cpp b/install/fuse_install.cpp
index ffde4a348..8a7a278e0 100644
--- a/install/fuse_install.cpp
+++ b/install/fuse_install.cpp
@@ -128,11 +128,12 @@ static bool StartInstallPackageFuse(std::string_view path) {
constexpr auto FUSE_BLOCK_SIZE = 65536;
bool is_block_map = android::base::ConsumePrefix(&path, "@");
- auto file_data_reader =
+ auto fuse_data_provider =
is_block_map ? FuseBlockDataProvider::CreateFromBlockMap(std::string(path), FUSE_BLOCK_SIZE)
: FuseFileDataProvider::CreateFromFile(std::string(path), FUSE_BLOCK_SIZE);
- if (!file_data_reader->Valid()) {
+ if (!fuse_data_provider || !fuse_data_provider->Valid()) {
+ LOG(ERROR) << "Failed to create fuse data provider.";
return false;
}
@@ -142,7 +143,7 @@ static bool StartInstallPackageFuse(std::string_view path) {
umount2(SDCARD_ROOT, MNT_DETACH);
}
- return run_fuse_sideload(std::move(file_data_reader)) == 0;
+ return run_fuse_sideload(std::move(fuse_data_provider)) == 0;
}
InstallResult InstallWithFuseFromPath(std::string_view path, RecoveryUI* ui) {