summaryrefslogtreecommitdiff
path: root/adb/file_sync_client.cpp
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2015-11-30 10:21:25 -0800
committerJosh Gao <jmgao@google.com>2015-11-30 10:42:37 -0800
commitdd6cc4d7eee1669a44cbe1f72ce3325aba2bf0f9 (patch)
tree0457203e59479529ad9512c4742d6784cea171a5 /adb/file_sync_client.cpp
parent0380d49024a408c726d3336551840381a6fbff45 (diff)
adb: correctly count skipped files in push/pull
Bug: http://b/25650207 Change-Id: I055b08216938640c4f7c5e96a7ea3719bf90ba70
Diffstat (limited to 'adb/file_sync_client.cpp')
-rw-r--r--adb/file_sync_client.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/adb/file_sync_client.cpp b/adb/file_sync_client.cpp
index e109e3eef4..320891de16 100644
--- a/adb/file_sync_client.cpp
+++ b/adb/file_sync_client.cpp
@@ -552,11 +552,12 @@ static bool local_build_list(SyncConnection& sc, std::vector<copyinfo>* filelist
} else {
if (!S_ISREG(st.st_mode) && !S_ISLNK(st.st_mode)) {
sc.Error("skipping special file '%s'", lpath.c_str());
+ ci.skip = true;
} else {
ci.time = st.st_mtime;
ci.size = st.st_size;
- filelist->push_back(ci);
}
+ filelist->push_back(ci);
}
}
@@ -723,8 +724,7 @@ static bool remote_build_list(SyncConnection& sc,
bool empty_dir = true;
// Put the files/dirs in rpath on the lists.
- auto callback = [&](unsigned mode, unsigned size, unsigned time,
- const char* name) {
+ auto callback = [&](unsigned mode, unsigned size, unsigned time, const char* name) {
if (IsDotOrDotDot(name)) {
return;
}
@@ -735,12 +735,15 @@ static bool remote_build_list(SyncConnection& sc,
copyinfo ci = mkcopyinfo(lpath, rpath, name, mode);
if (S_ISDIR(mode)) {
dirlist.push_back(ci);
- } else if (S_ISREG(mode) || S_ISLNK(mode)) {
- ci.time = time;
- ci.size = size;
- filelist->push_back(ci);
} else {
- sc.Warning("skipping special file '%s'\n", name);
+ if (S_ISREG(mode) || S_ISLNK(mode)) {
+ ci.time = time;
+ ci.size = size;
+ } else {
+ sc.Warning("skipping special file '%s'\n", name);
+ ci.skip = true;
+ }
+ filelist->push_back(ci);
}
};