From 603f4cfca644c3afc75a4615f4b837e0bc6f3abf Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Tue, 17 Jul 2012 16:18:24 +0200 Subject: ipsw: Use different error codes in ipsw_download_latest_fw() for handling --- src/ipsw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/ipsw.c') 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; } } } -- cgit v1.1-32-gdbae