diff options
author | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-02 02:28:16 +0000 |
---|---|---|
committer | evan@chromium.org <evan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-02 02:28:16 +0000 |
commit | cabe39c43a98b6b635951d5cb3649e061e36ea21 (patch) | |
tree | c76282b5ed8452f490edbda9ed0a32bf364b5d6a /base/debug_util_posix.cc | |
parent | ce716d859764f7a6e8ea0c79bbcd445d856f4da0 (diff) | |
download | chromium_src-cabe39c43a98b6b635951d5cb3649e061e36ea21.zip chromium_src-cabe39c43a98b6b635951d5cb3649e061e36ea21.tar.gz chromium_src-cabe39c43a98b6b635951d5cb3649e061e36ea21.tar.bz2 |
linux: check the return value passed through HANDLE_EINTR
A smarter compiler (clang) can notice that we were not using the return
values being passed through HANDLE_EINTR, which meant most frequently
that we were missing checking the return value of close().
Review URL: http://codereview.chromium.org/569003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@37786 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/debug_util_posix.cc')
-rw-r--r-- | base/debug_util_posix.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/base/debug_util_posix.cc b/base/debug_util_posix.cc index a57f102..0cccd9e 100644 --- a/base/debug_util_posix.cc +++ b/base/debug_util_posix.cc @@ -203,7 +203,8 @@ bool DebugUtil::BeingDebugged() { char buf[1024]; ssize_t num_read = HANDLE_EINTR(read(status_fd, buf, sizeof(buf))); - HANDLE_EINTR(close(status_fd)); + if (HANDLE_EINTR(close(status_fd)) < 0) + return false; if (num_read <= 0) return false; |