summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2012-07-17 16:18:24 +0200
committerGravatar Nikias Bassen2012-07-17 16:18:24 +0200
commit603f4cfca644c3afc75a4615f4b837e0bc6f3abf (patch)
tree56eca8f382291d43916695412bcfced1bfdba26b
parentbc4e8ec23a60e6936497826f29cbed39da4f964b (diff)
downloadidevicerestore-603f4cfca644c3afc75a4615f4b837e0bc6f3abf.tar.gz
idevicerestore-603f4cfca644c3afc75a4615f4b837e0bc6f3abf.tar.bz2
ipsw: Use different error codes in ipsw_download_latest_fw() for handling
-rw-r--r--src/ipsw.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ipsw.c b/src/ipsw.c
index a66d4b1..19f73ab 100644
--- a/src/ipsw.c
+++ b/src/ipsw.c
@@ -405,7 +405,7 @@ int ipsw_download_latest_fw(plist_t version_data, const char* product, const cha
char* fwfn = strrchr(fwurl, '/');
if (!fwfn) {
error("ERROR: can't get local filename for firmware ipsw\n");
- return -1;
+ return -2;
}
fwfn++;
@@ -445,7 +445,7 @@ int ipsw_download_latest_fw(plist_t version_data, const char* product, const cha
if (need_dl) {
if (strncmp(fwurl, "protected:", 10) == 0) {
error("ERROR: Can't download '%s' because it needs a purchase.\n", fwfn);
- res = -1;
+ res = -3;
} else {
remove(fwlfn);
info("Downloading latest firmware (%s)\n", fwurl);
@@ -458,7 +458,7 @@ int ipsw_download_latest_fw(plist_t version_data, const char* product, const cha
info("Checksum matches.\n");
} else {
error("ERROR: File download failed (checksum mismatch).\n");
- res = -1;
+ res = -4;
}
fclose(f);
@@ -467,7 +467,7 @@ int ipsw_download_latest_fw(plist_t version_data, const char* product, const cha
remove(fwlfn);
} else {
error("ERROR: Can't open '%s' for checksum verification\n", fwlfn);
- res = -1;
+ res = -5;
}
}
}