summaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authorJP Abgrall <jpa@google.com>2014-03-11 18:51:48 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-11 18:51:48 +0000
commit8a00ce939aca70aaba4138391441e6b4047ff12d (patch)
treef26b29d81c55273638cfe1de1a6f9d67ee5ac123 /adb
parent269fcd66e6cab1b8f90f4081b97fb6decf7a9a0c (diff)
parentb2c34ece647c212baa30c474394c498a2d6dd61f (diff)
downloadsystem_core-8a00ce939aca70aaba4138391441e6b4047ff12d.tar.gz
system_core-8a00ce939aca70aaba4138391441e6b4047ff12d.tar.bz2
system_core-8a00ce939aca70aaba4138391441e6b4047ff12d.zip
am b2c34ece: Merge "adb: Don\'t clobber block devices during push"
* commit 'b2c34ece647c212baa30c474394c498a2d6dd61f': adb: Don't clobber block devices during push
Diffstat (limited to 'adb')
-rw-r--r--adb/file_sync_service.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/adb/file_sync_service.c b/adb/file_sync_service.c
index e981c2a50..25bfdc983 100644
--- a/adb/file_sync_service.c
+++ b/adb/file_sync_service.c
@@ -339,11 +339,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);