summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ideviceinstaller.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/ideviceinstaller.c b/src/ideviceinstaller.c
index 17f7c17..55f3062 100644
--- a/src/ideviceinstaller.c
+++ b/src/ideviceinstaller.c
@@ -36,6 +36,9 @@
36#include <limits.h> 36#include <limits.h>
37#include <sys/stat.h> 37#include <sys/stat.h>
38#include <dirent.h> 38#include <dirent.h>
39#ifdef HAVE_UNISTD_H
40#include <unistd.h>
41#endif
39 42
40#include <libimobiledevice/libimobiledevice.h> 43#include <libimobiledevice/libimobiledevice.h>
41#include <libimobiledevice/lockdown.h> 44#include <libimobiledevice/lockdown.h>
@@ -537,6 +540,14 @@ static void afc_upload_dir(afc_client_t afc, const char* path, const char* afcpa
537 strcat(apath, "/"); 540 strcat(apath, "/");
538 strcat(apath, ep->d_name); 541 strcat(apath, ep->d_name);
539 542
543#ifdef HAVE_LSTAT
544 if ((lstat(fpath, &st) == 0) && S_ISLNK(st.st_mode)) {
545 char *target = (char *)malloc(st.st_size);
546 readlink(fpath, target, st.st_size);
547 afc_make_link(afc, AFC_SYMLINK, target, fpath);
548 free(target);
549 } else
550#endif
540 if ((stat(fpath, &st) == 0) && S_ISDIR(st.st_mode)) { 551 if ((stat(fpath, &st) == 0) && S_ISDIR(st.st_mode)) {
541 afc_upload_dir(afc, fpath, apath); 552 afc_upload_dir(afc, fpath, apath);
542 } else { 553 } else {