Fix double close in GetTreeBytes.

calculate_dir_size closes the fd that it receives.

Bug: http://b/80446935
Test: treehugger
Change-Id: I56a428cd7eb78e56c55434628c1c7b2b87637c81
gugelfrei
Josh Gao 6 years ago
parent 6054bc3ded
commit 72fb1a6d6c

@ -523,9 +523,7 @@ uint64_t GetTreeBytes(const std::string& path) {
PLOG(WARNING) << "Failed to open " << path;
return -1;
} else {
uint64_t res = calculate_dir_size(dirfd);
close(dirfd);
return res;
return calculate_dir_size(dirfd);
}
}

Loading…
Cancel
Save