summaryrefslogtreecommitdiffstats
path: root/adbbu/adbbumain.cpp
diff options
context:
space:
mode:
authorbigbiff bigbiff <bigbiff@teamw.in>2017-09-25 16:51:56 +0200
committerDees Troy <dees_troy@teamw.in>2017-11-27 16:43:20 +0100
commitadcb4d8cb7ee3ace4f0ee4a8ee8968b744db56b0 (patch)
tree0a1993c0cffa55a78c6674045c0b9083c22f2db8 /adbbu/adbbumain.cpp
parentADB Backup: add ability for TWRP GUI to restore (diff)
downloadandroid_bootable_recovery-adcb4d8cb7ee3ace4f0ee4a8ee8968b744db56b0.tar
android_bootable_recovery-adcb4d8cb7ee3ace4f0ee4a8ee8968b744db56b0.tar.gz
android_bootable_recovery-adcb4d8cb7ee3ace4f0ee4a8ee8968b744db56b0.tar.bz2
android_bootable_recovery-adcb4d8cb7ee3ace4f0ee4a8ee8968b744db56b0.tar.lz
android_bootable_recovery-adcb4d8cb7ee3ace4f0ee4a8ee8968b744db56b0.tar.xz
android_bootable_recovery-adcb4d8cb7ee3ace4f0ee4a8ee8968b744db56b0.tar.zst
android_bootable_recovery-adcb4d8cb7ee3ace4f0ee4a8ee8968b744db56b0.zip
Diffstat (limited to 'adbbu/adbbumain.cpp')
-rw-r--r--adbbu/adbbumain.cpp11
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;
}