summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@google.com>2021-08-06 10:19:53 -0700
committerBart Van Assche <bvanassche@google.com>2021-08-16 11:04:18 -0700
commitc554240e647c14a5067537fcf8ef88e92b431e12 (patch)
tree4f26e04fcb34ef691590d9e15ef3f3a3236fa2e1
parent98f87ca8a7ffe67f3eedecdff9182fb44fe1ffcd (diff)
downloadcore-c554240e647c14a5067537fcf8ef88e92b431e12.tar.gz
Rename two local variables
Improve code readability by renaming 'device' into 'loop_device' and 'device_fd' into 'loop_fd'. Bug: 194894000 Test: Built Android images and installed these on an Android device. Merged-In: Ia9c2d7a525e727f8706e66631b97fc4678c6a4d9 Change-Id: I3fa0c9ca53277b621bb5b81aca394a3079c6e0a3 Ignore-AOSP-First: Already in AOSP. Signed-off-by: Bart Van Assche <bvanassche@google.com>
-rw-r--r--fs_mgr/fs_mgr.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/fs_mgr/fs_mgr.cpp b/fs_mgr/fs_mgr.cpp
index af71fe6d5..6b8e39eec 100644
--- a/fs_mgr/fs_mgr.cpp
+++ b/fs_mgr/fs_mgr.cpp
@@ -2065,22 +2065,22 @@ static bool PrepareZramBackingDevice(off64_t size) {
// Allocate loop device and attach it to file_path.
LoopControl loop_control;
- std::string device;
- if (!loop_control.Attach(target_fd.get(), 5s, &device)) {
+ std::string loop_device;
+ if (!loop_control.Attach(target_fd.get(), 5s, &loop_device)) {
return false;
}
// set block size & direct IO
- unique_fd device_fd(TEMP_FAILURE_RETRY(open(device.c_str(), O_RDWR | O_CLOEXEC)));
- if (device_fd.get() == -1) {
- PERROR << "Cannot open " << device;
+ unique_fd loop_fd(TEMP_FAILURE_RETRY(open(loop_device.c_str(), O_RDWR | O_CLOEXEC)));
+ if (loop_fd.get() == -1) {
+ PERROR << "Cannot open " << loop_device;
return false;
}
- if (!LoopControl::EnableDirectIo(device_fd.get())) {
+ if (!LoopControl::EnableDirectIo(loop_fd.get())) {
return false;
}
- return InstallZramDevice(device);
+ return InstallZramDevice(loop_device);
}
bool fs_mgr_swapon_all(const Fstab& fstab) {