summaryrefslogtreecommitdiffstats
path: root/src/ideviceinstaller.c
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 /src/ideviceinstaller.c
parent47674f7256b2bd6da3fdc924f8f49a85a75e515c (diff)
downloadideviceinstaller-127f9d363fb59abb68104ae0386e891ecdfcf63f.tar.gz
ideviceinstaller-127f9d363fb59abb68104ae0386e891ecdfcf63f.tar.bz2
move creation of PublicStaging directory to the top
Diffstat (limited to 'src/ideviceinstaller.c')
-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:
637 goto leave_cleanup; 637 goto leave_cleanup;
638 } 638 }
639 639
640 char **strs = NULL;
641 if (afc_get_file_info(afc, PKG_PATH, &strs) != AFC_E_SUCCESS) {
642 if (afc_make_directory(afc, PKG_PATH) != AFC_E_SUCCESS) {
643 fprintf(stderr, "WARNING: Could not create directory '%s' on device!\n", PKG_PATH);
644 }
645 }
646 if (strs) {
647 int i = 0;
648 while (strs[i]) {
649 free(strs[i]);
650 i++;
651 }
652 free(strs);
653 }
654
640 /* open install package */ 655 /* open install package */
641 int errp = 0; 656 int errp = 0;
642 struct zip *zf = zip_open(appid, 0, &errp); 657 struct zip *zf = zip_open(appid, 0, &errp);
@@ -831,21 +846,6 @@ run_again:
831 846
832 printf("Copying '%s' --> '%s'\n", appid, pkgname); 847 printf("Copying '%s' --> '%s'\n", appid, pkgname);
833 848
834 char **strs = NULL;
835 if (afc_get_file_info(afc, PKG_PATH, &strs) != AFC_E_SUCCESS) {
836 if (afc_make_directory(afc, PKG_PATH) != AFC_E_SUCCESS) {
837 fprintf(stderr, "WARNING: Could not create directory '%s' on device!\n", PKG_PATH);
838 }
839 }
840 if (strs) {
841 int i = 0;
842 while (strs[i]) {
843 free(strs[i]);
844 i++;
845 }
846 free(strs);
847 }
848
849 if (afc_upload_file(afc, appid, pkgname) < 0) { 849 if (afc_upload_file(afc, appid, pkgname) < 0) {
850 free(pkgname); 850 free(pkgname);
851 goto leave_cleanup; 851 goto leave_cleanup;