From 127f9d363fb59abb68104ae0386e891ecdfcf63f Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Thu, 18 Jul 2013 16:21:02 +0200 Subject: move creation of PublicStaging directory to the top --- src/ideviceinstaller.c | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c index 2d07a03..a99df2c 100644 --- a/src/ideviceinstaller.c +++ b/src/ideviceinstaller.c @@ -637,6 +637,21 @@ run_again: goto leave_cleanup; } + char **strs = NULL; + if (afc_get_file_info(afc, PKG_PATH, &strs) != AFC_E_SUCCESS) { + if (afc_make_directory(afc, PKG_PATH) != AFC_E_SUCCESS) { + fprintf(stderr, "WARNING: Could not create directory '%s' on device!\n", PKG_PATH); + } + } + if (strs) { + int i = 0; + while (strs[i]) { + free(strs[i]); + i++; + } + free(strs); + } + /* open install package */ int errp = 0; struct zip *zf = zip_open(appid, 0, &errp); @@ -831,21 +846,6 @@ run_again: printf("Copying '%s' --> '%s'\n", appid, pkgname); - char **strs = NULL; - if (afc_get_file_info(afc, PKG_PATH, &strs) != AFC_E_SUCCESS) { - if (afc_make_directory(afc, PKG_PATH) != AFC_E_SUCCESS) { - fprintf(stderr, "WARNING: Could not create directory '%s' on device!\n", PKG_PATH); - } - } - if (strs) { - int i = 0; - while (strs[i]) { - free(strs[i]); - i++; - } - free(strs); - } - if (afc_upload_file(afc, appid, pkgname) < 0) { free(pkgname); goto leave_cleanup; -- cgit v1.1-32-gdbae