summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2013-07-18 16:21:02 +0200
committerGravatar Nikias Bassen2013-07-18 16:21:02 +0200
commit127f9d363fb59abb68104ae0386e891ecdfcf63f (patch)
tree5a88efb4dce0101411cdbc153672ba0632ef2e44
parent47674f7256b2bd6da3fdc924f8f49a85a75e515c (diff)
downloadideviceinstaller-127f9d363fb59abb68104ae0386e891ecdfcf63f.tar.gz
ideviceinstaller-127f9d363fb59abb68104ae0386e891ecdfcf63f.tar.bz2
move creation of PublicStaging directory to the top
-rw-r--r--src/ideviceinstaller.c30
1 files changed, 15 insertions, 15 deletions
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;