diff options
author | Martin Szulecki | 2012-07-17 17:29:32 +0200 |
---|---|---|
committer | Nikias Bassen | 2012-07-17 17:29:32 +0200 |
commit | a096545aaab6fb55c058c983a67336b80053f5af (patch) | |
tree | 44f63e63d3ab5dcbc6272aa77afd716a5e7c94d7 /src/idevicerestore.c | |
parent | 17e12aea1dd797846f679a4f157c9d954b530874 (diff) | |
download | idevicerestore-a096545aaab6fb55c058c983a67336b80053f5af.tar.gz idevicerestore-a096545aaab6fb55c058c983a67336b80053f5af.tar.bz2 |
main: Grab result code of restore_device() call and return as global error code
Diffstat (limited to 'src/idevicerestore.c')
-rw-r--r-- | src/idevicerestore.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/idevicerestore.c b/src/idevicerestore.c index a6fba99..4d1d8d5 100644 --- a/src/idevicerestore.c +++ b/src/idevicerestore.c @@ -155,6 +155,7 @@ int main(int argc, char* argv[]) { int latest = 0; char* shsh_dir = NULL; use_apple_server=1; + int result = 0; // create an instance of our context struct idevicerestore_client_t* client = (struct idevicerestore_client_t*) malloc(sizeof(struct idevicerestore_client_t)); @@ -791,11 +792,12 @@ int main(int argc, char* argv[]) { // device is finally in restore mode, let's do this if (client->mode->index == MODE_RESTORE) { info("About to restore device... \n"); - if (restore_device(client, build_identity, filesystem) < 0) { + result = restore_device(client, build_identity, filesystem); + if (result < 0) { error("ERROR: Unable to restore device\n"); if (filesystem) unlink(filesystem); - return -1; + return result; } } @@ -804,7 +806,7 @@ int main(int argc, char* argv[]) { unlink(filesystem); info("DONE\n"); - return 0; + return result; } int check_mode(struct idevicerestore_client_t* client) { |