From 57eedbf8cbd21899a3395ce6f153cd0e05898f3b Mon Sep 17 00:00:00 2001 From: Paul Crowley Date: Tue, 9 Feb 2016 09:30:23 +0000 Subject: [PATCH] Fix some "false" returns to be "-1" where appropriate in e4crypt_enable Also fix a PLOG that should be a LOG. Change-Id: Ic5ae288c37b6e236172f9e38349c2d0d530bfd4d --- Ext4Crypt.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Ext4Crypt.cpp b/Ext4Crypt.cpp index eaa08db..d4d49af 100644 --- a/Ext4Crypt.cpp +++ b/Ext4Crypt.cpp @@ -366,11 +366,11 @@ int e4crypt_enable(const char* path) 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 @@ int e4crypt_lock_user_key(userid_t user_id) { 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; } }