Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- From e9d7c4dad3de1c72db8bce7ecec906f235179755 Mon Sep 17 00:00:00 2001
- From: Christien Rioux <crioux@blink.veracode.local>
- Date: Wed, 2 Oct 2013 13:16:24 -0400
- Subject: [PATCH] add symlinks
- ---
- src/ideviceinstaller.c | 11 +++++++++--
- 1 file changed, 9 insertions(+), 2 deletions(-)
- diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c
- index 3aac8ae..ce66cc7 100644
- --- a/src/ideviceinstaller.c
- +++ b/src/ideviceinstaller.c
- @@ -36,6 +36,7 @@
- #include <limits.h>
- #include <sys/stat.h>
- #include <dirent.h>
- +#include <unistd.h>
- #include <libimobiledevice/libimobiledevice.h>
- #include <libimobiledevice/lockdown.h>
- @@ -452,8 +453,14 @@ static void afc_upload_dir(afc_client_t afc, const char* path, const char* afcpa
- strcpy(apath, afcpath);
- strcat(apath, "/");
- strcat(apath, ep->d_name);
- -
- - if ((stat(fpath, &st) == 0) && S_ISDIR(st.st_mode)) {
- +
- + if ((lstat(fpath, &st)==0) && S_ISLNK(st.st_mode)) {
- + char *target=(char *)malloc(st.st_size);
- + readlink(fpath,target,st.st_size);
- + afc_make_link(afc,AFC_SYMLINK,target,fpath);
- + free(target);
- + }
- + else if ((stat(fpath, &st) == 0) && S_ISDIR(st.st_mode)) {
- afc_upload_dir(afc, fpath, apath);
- } else {
- afc_upload_file(afc, fpath, apath);
- --
- 1.8.3.4 (Apple Git-47)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement