diff options
Diffstat (limited to 'adbbu/adbbumain.cpp')
-rw-r--r-- | adbbu/adbbumain.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/adbbu/adbbumain.cpp b/adbbu/adbbumain.cpp index 050c9bc4a..4f5efec4c 100644 --- a/adbbu/adbbumain.cpp +++ b/adbbu/adbbumain.cpp @@ -31,7 +31,8 @@ int main(int argc, char **argv) { int index; - int ret = 0, pos = 0; + int pos = 0; + bool ret = false; int maxpos = sizeof(TWRPARG + 2); std::string command; twrpback tw; @@ -73,8 +74,9 @@ int main(int argc, char **argv) { else if (command.substr(0, sizeof(TWRP_STREAM_ARG) - 1) == TWRP_STREAM_ARG) { tw.setStreamFileName(argv[3]); tw.threadStream(); + ret = true; } - if (ret == 0) + if (ret) tw.adblogwrite("Adb backup/restore completed\n"); else tw.adblogwrite("Adb backup/restore failed\n"); @@ -85,5 +87,8 @@ int main(int argc, char **argv) { tw.adblogwrite("Unable to remove TW_ADB_BU_CONTROL: " + str.str()); } unlink(TW_ADB_TWRP_CONTROL); - return ret; + if (ret) + return 0; + else + return -1; } |