am 270ebefc: am b2c34ece: Merge "adb: Don\'t clobber block devices during push"

* commit '270ebefc6c0c7937e8bef112a257b25509a1c2b7':
  adb: Don't clobber block devices during push
This commit is contained in:
JP Abgrall 2014-03-08 02:00:30 +00:00 committed by Android Git Automerger
commit beea8a77a1

View file

@ -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);