summaryrefslogtreecommitdiffstats
path: root/base/file_util_posix.cc
diff options
context:
space:
mode:
authorphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-27 13:38:01 +0000
committerphajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-04-27 13:38:01 +0000
commit3bbb6756823e795c9dd523e90b8c113e741dad71 (patch)
treef479e093d5bbfd0e1d8570268c2ff73fb4ce7d69 /base/file_util_posix.cc
parentbf2533c6e4d3b38baab0ca906a27191cc5ec779a (diff)
downloadchromium_src-3bbb6756823e795c9dd523e90b8c113e741dad71.zip
chromium_src-3bbb6756823e795c9dd523e90b8c113e741dad71.tar.gz
chromium_src-3bbb6756823e795c9dd523e90b8c113e741dad71.tar.bz2
Only check errno when it can be set.
This is a follow-up after http://codereview.chromium.org/77022 Review URL: http://codereview.chromium.org/99055 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14602 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/file_util_posix.cc')
-rw-r--r--base/file_util_posix.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/base/file_util_posix.cc b/base/file_util_posix.cc
index 073c58e..f218460 100644
--- a/base/file_util_posix.cc
+++ b/base/file_util_posix.cc
@@ -338,7 +338,7 @@ bool ReadFromFD(int fd, char* buffer, size_t bytes) {
ssize_t bytes_read = read(fd, buffer + total_read, bytes - total_read);
if (bytes_read > 0)
total_read += bytes_read;
- else if (errno != EINTR || bytes_read == 0)
+ else if (bytes_read == 0 || errno != EINTR)
break;
}
return total_read == bytes;