commit | 72fb1a6d6c02cc01868a2b2e74342d0b8ae683e6 | [log] [tgz] |
---|---|---|
author | Josh Gao <jmgao@google.com> | Tue May 29 19:05:16 2018 -0700 |
committer | Josh Gao <jmgao@google.com> | Wed May 30 11:13:42 2018 -0700 |
tree | c81f0a3d72e9b576655ebf8ec96a0946ba799e99 | |
parent | 6054bc3ded9f35d07a3b17a4f1849c85bec05c9b [diff] |
Fix double close in GetTreeBytes. calculate_dir_size closes the fd that it receives. Bug: http://b/80446935 Test: treehugger Change-Id: I56a428cd7eb78e56c55434628c1c7b2b87637c81
diff --git a/Utils.cpp b/Utils.cpp index b6c7bf8..102c09a 100644 --- a/Utils.cpp +++ b/Utils.cpp
@@ -523,9 +523,7 @@ 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); } }