summaryrefslogtreecommitdiff
path: root/base/errors_unix.cpp
diff options
context:
space:
mode:
authorJosh Gao <jmgao@google.com>2015-11-30 10:53:22 -0800
committerJosh Gao <jmgao@google.com>2015-11-30 12:03:12 -0800
commitb0e039f4ca1dd59a13078bb9bb4c24daac93cd84 (patch)
tree0c8cc96bcc80e7dbb25741c448c414e75dd2e457 /base/errors_unix.cpp
parent0380d49024a408c726d3336551840381a6fbff45 (diff)
adb: don't divide by zero
If we stat a file and get a size of 0, and then successfully read bytes from that file, we would previously divide by zero when calculating the percentage completion of the file. This case happens either when we're racing against something else writing to the file, or when we're pulling magical files such as the ones in /dev/cpuctl/ that lie about their size. Bug: http://b/25925733 Change-Id: I980b9c14f44a1eb4a42bc8736c94fa6db06c08d1
Diffstat (limited to 'base/errors_unix.cpp')
0 files changed, 0 insertions, 0 deletions