adb: make local_build_list match remote_build_list.

local_build_list previously was returning an int, 0 on success and -1 on
failure, while remote_build_list was returning a bool, true on success
and false on failure.

Change-Id: Iced6c4142e2f843048d81c4e133d6b6dc75a35dd
This commit is contained in:
Josh Gao 2015-11-03 15:26:38 -08:00
parent d97315731f
commit cd7c1ed700
1 changed files with 6 additions and 5 deletions

View File

@ -495,13 +495,14 @@ static bool IsDotOrDotDot(const char* name) {
return name[0] == '.' && (name[1] == '\0' || (name[1] == '.' && name[2] == '\0'));
}
static int local_build_list(SyncConnection& sc, std::vector<copyinfo>* filelist,
const std::string& lpath, const std::string& rpath) {
static bool local_build_list(SyncConnection& sc, std::vector<copyinfo>* filelist,
const std::string& lpath,
const std::string& rpath) {
std::vector<copyinfo> dirlist;
std::unique_ptr<DIR, int (*)(DIR*)> dir(opendir(lpath.c_str()), closedir);
if (!dir) {
sc.Error("cannot open '%s': %s", lpath.c_str(), strerror(errno));
return -1;
return false;
}
dirent* de;
@ -537,7 +538,7 @@ static int local_build_list(SyncConnection& sc, std::vector<copyinfo>* filelist,
local_build_list(sc, filelist, ci.src.c_str(), ci.dst.c_str());
}
return 0;
return true;
}
static bool copy_local_dir_remote(SyncConnection& sc, std::string lpath,
@ -558,7 +559,7 @@ static bool copy_local_dir_remote(SyncConnection& sc, std::string lpath,
std::vector<copyinfo> filelist;
int pushed = 0;
int skipped = 0;
if (local_build_list(sc, &filelist, lpath, rpath)) {
if (!local_build_list(sc, &filelist, lpath, rpath)) {
return false;
}