From 50d63be5805c5f7fffd5f15187854439eec83beb Mon Sep 17 00:00:00 2001 From: Dees_Troy Date: Sat, 2 Mar 2013 08:49:30 -0600 Subject: Fix capturing exit status to properly display libtar results Error conditions were always showing successful in the TWRP GUI making it much more difficult to determine if a backup or restore was actually successful. --- twrpTar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/twrpTar.cpp b/twrpTar.cpp index 159c1d1b9..cf225db58 100644 --- a/twrpTar.cpp +++ b/twrpTar.cpp @@ -107,7 +107,7 @@ int twrpTar::createTarFork() { LOGI("Child process ended with signal: %d\n", WTERMSIG(status)); return -1; } - else if (WIFEXITED(status) != 0) + else if (WEXITSTATUS(status) == 0) LOGI("Tar creation successful\n"); else { LOGI("Tar creation failed\n"); @@ -141,7 +141,7 @@ int twrpTar::extractTarFork() { LOGI("Child process ended with signal: %d\n", WTERMSIG(status)); return -1; } - else if (WIFEXITED(status) != 0) + else if (WEXITSTATUS(status) == 0) LOGI("Tar extraction successful\n"); else { LOGI("Tar extraction failed\n"); -- cgit v1.2.3