Fix some "false" returns to be "-1" where appropriate in e4crypt_enable
Also fix a PLOG that should be a LOG.
Change-Id: Ic5ae288c37b6e236172f9e38349c2d0d530bfd4d
diff --git a/Ext4Crypt.cpp b/Ext4Crypt.cpp
index eaa08db..d4d49af 100644
--- a/Ext4Crypt.cpp
+++ b/Ext4Crypt.cpp
@@ -366,11 +366,11 @@
android::vold::destroyKey(key_temp);
}
- if (!android::vold::storeKey(key_temp, kEmptyAuthentication, device_key)) return false;
+ if (!android::vold::storeKey(key_temp, kEmptyAuthentication, device_key)) return -1;
if (rename(key_temp.c_str(), device_key_path.c_str()) != 0) {
PLOG(ERROR) << "Unable to move new key to location: "
<< device_key_path;
- return false;
+ return -1;
}
}
@@ -590,7 +590,7 @@
emulated_lock(android::vold::BuildDataMiscCePath(user_id)) ||
emulated_lock(android::vold::BuildDataMediaPath(nullptr, user_id)) ||
emulated_lock(android::vold::BuildDataUserPath(nullptr, user_id))) {
- PLOG(ERROR) << "Failed to lock user " << user_id;
+ LOG(ERROR) << "Failed to lock user " << user_id;
return -1;
}
}