Is_Data_Wiped: simplify function signature
Change-Id: If724d38639cffe1f1ff5658503ed31ffd1ef72e8
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index 7673795..d3d1be2 100755
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -640,7 +640,7 @@
int TWFunc::tw_reboot(RebootCommand command)
{
DataManager::Flush();
- if (!Is_Data_Wiped("/data"))
+ if (!Is_Data_Wiped())
Update_Log_File();
// Always force a sync before we reboot
@@ -1366,9 +1366,10 @@
return true;
}
-bool TWFunc::Is_Data_Wiped(std::string path) {
+bool TWFunc::Is_Data_Wiped() {
+ std::string data_path = "/data";
#ifdef TW_INCLUDE_FBE
- DIR* d = opendir(path.c_str());
+ DIR* d = opendir(data_path.c_str());
size_t file_count = 0;
if (d != NULL) {
struct dirent* de;
diff --git a/twrp-functions.hpp b/twrp-functions.hpp
index fa66645..8e7005e 100755
--- a/twrp-functions.hpp
+++ b/twrp-functions.hpp
@@ -122,7 +122,7 @@
static int Property_Override(string Prop_Name, string Prop_Value); // Override properties (including ro. properties)
static bool Get_Encryption_Policy(ext4_encryption_policy &policy, std::string path); // return encryption policy for path
static bool Set_Encryption_Policy(std::string path, const ext4_encryption_policy &policy); // set encryption policy for path
- static bool Is_Data_Wiped(std::string path); // check if directory has been wiped
+ static bool Is_Data_Wiped(); // check if directory has been wiped
private:
static void Copy_Log(string Source, string Destination);
diff --git a/twrp.cpp b/twrp.cpp
index 37053d2..1e3f860 100755
--- a/twrp.cpp
+++ b/twrp.cpp
@@ -404,7 +404,7 @@
// Reboot
TWFunc::Update_Intent_File(Send_Intent);
delete adb_bu_fifo;
- if (!TWFunc::Is_Data_Wiped("/data"))
+ if (!TWFunc::Is_Data_Wiped())
TWFunc::Update_Log_File();
gui_msg(Msg("rebooting=Rebooting..."));
string Reboot_Arg;