summaryrefslogtreecommitdiffstats
path: root/adb
diff options
context:
space:
mode:
authoreric.yan <severecold@gmail.com>2015-02-03 22:16:29 +0800
committerapachegroup . <severecold@gmail.com>2015-02-09 13:41:27 +0000
commita859219fec34ea0207c97a225c9f3fe451fc1209 (patch)
treed110ecd49a80c63c000cf2ffbeacf2564565432f /adb
parent5ac8b917ded904500f44c8c02b277a34eb9c14c7 (diff)
downloadsystem_core-a859219fec34ea0207c97a225c9f3fe451fc1209.zip
system_core-a859219fec34ea0207c97a225c9f3fe451fc1209.tar.gz
system_core-a859219fec34ea0207c97a225c9f3fe451fc1209.tar.bz2
fix bug that passing invalid fd to fstats on win32 builds
lfd returned by adb_open is not the actual file desc. on win32 builds. calling through fstat with invalid fd will lead to crash, using stat instead. Change-Id: I7fdc8b825162eaa42efe8755265842c300b00e39 Signed-off-by: eric.yan <eric.yan@yulong.com> Signed-off-by: severecold <severecold@gmail.com>
Diffstat (limited to 'adb')
-rw-r--r--adb/file_sync_client.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/adb/file_sync_client.c b/adb/file_sync_client.c
index ee09d5d..f93c876 100644
--- a/adb/file_sync_client.c
+++ b/adb/file_sync_client.c
@@ -240,7 +240,7 @@ static int write_data_file(int fd, const char *path, syncsendbuf *sbuf, int show
if (show_progress) {
// Determine local file size.
struct stat st;
- if (fstat(lfd, &st)) {
+ if (stat(path, &st)) {
fprintf(stderr,"cannot stat '%s': %s\n", path, strerror(errno));
return -1;
}