Merge "Fix the MapWithLoopDevice" am: 79f7e3f1fc

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1545227

MUST ONLY BE SUBMITTED BY AUTOMERGER

Change-Id: I469c201ab3d1d7d893d59161cefa0159ce0f91f7
This commit is contained in:
Howard Chen 2021-01-20 03:37:45 +00:00 committed by Automerger Merge Worker
commit 09cbf21fc0

View file

@ -486,15 +486,14 @@ bool ImageManager::MapWithLoopDevice(const std::string& name,
if (!MapWithLoopDeviceList(loop_devices, name, timeout_ms, path)) {
return false;
}
} else {
auto status_message = "loop:" + loop_devices.back();
auto status_file = GetStatusFilePath(name);
if (!android::base::WriteStringToFile(status_message, status_file)) {
PLOG(ERROR) << "Write failed: " << status_file;
return false;
}
}
auto status_message = "loop:" + loop_devices.back();
auto status_file = GetStatusFilePath(name);
if (!android::base::WriteStringToFile(status_message, status_file)) {
PLOG(ERROR) << "Write failed: " << status_file;
return false;
}
auto_detach.Commit();
*path = loop_devices.back();