diff options
Diffstat (limited to 'adb/file_sync_service.c')
| -rw-r--r-- | adb/file_sync_service.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/adb/file_sync_service.c b/adb/file_sync_service.c index c30f9fb..c2401b8 100644 --- a/adb/file_sync_service.c +++ b/adb/file_sync_service.c @@ -338,11 +338,14 @@ static int do_send(int s, char *path, char *buffer) if(!tmp || errno) { mode = 0644; is_link = 0; + } else { + struct stat st; + /* Don't delete files before copying if they are not "regular" */ + if(lstat(path, &st) || S_ISREG(st.st_mode) || S_ISLNK(st.st_mode)) { + adb_unlink(path); + } } - adb_unlink(path); - - #ifdef HAVE_SYMLINKS if(is_link) ret = handle_send_link(s, path, buffer); |
