summaryrefslogtreecommitdiffstats
path: root/base
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-23 00:37:46 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-23 00:37:46 +0000
commit70eb657d0e9575764e6d744a2fd36f7f7249c799 (patch)
treecbe69d505bf6978e1b0a70c9deb13e33c677b659 /base
parent44a34186a63080c37c70bddc0ecd2c5efc9d7fab (diff)
downloadchromium_src-70eb657d0e9575764e6d744a2fd36f7f7249c799.zip
chromium_src-70eb657d0e9575764e6d744a2fd36f7f7249c799.tar.gz
chromium_src-70eb657d0e9575764e6d744a2fd36f7f7249c799.tar.bz2
Clang: Do not ignore result of HANDLE_EINTR.
Review URL: http://codereview.chromium.org/2805026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50556 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base')
-rw-r--r--base/file_util.h4
-rw-r--r--base/message_loop_unittest.cc12
-rw-r--r--base/message_pump_libevent.cc12
3 files changed, 19 insertions, 9 deletions
diff --git a/base/file_util.h b/base/file_util.h
index a16c5c72..48f431f 100644
--- a/base/file_util.h
+++ b/base/file_util.h
@@ -35,6 +35,7 @@
#if defined(OS_POSIX)
#include "base/eintr_wrapper.h"
#include "base/file_descriptor_posix.h"
+#include "base/logging.h"
#endif
namespace base {
@@ -377,7 +378,8 @@ class ScopedFDClose {
public:
inline void operator()(int* x) const {
if (x && *x >= 0) {
- HANDLE_EINTR(close(*x));
+ if (HANDLE_EINTR(close(*x)) < 0)
+ PLOG(ERROR) << "close";
}
}
};
diff --git a/base/message_loop_unittest.cc b/base/message_loop_unittest.cc
index 6208e99..da0013c 100644
--- a/base/message_loop_unittest.cc
+++ b/base/message_loop_unittest.cc
@@ -1578,8 +1578,10 @@ TEST(MessageLoopTest, FileDescriptorWatcherOutlivesMessageLoop) {
// and don't run the message loop, just destroy it.
}
}
- HANDLE_EINTR(close(pipefds[0]));
- HANDLE_EINTR(close(pipefds[1]));
+ if (HANDLE_EINTR(close(pipefds[0])) < 0)
+ PLOG(ERROR) << "close";
+ if (HANDLE_EINTR(close(pipefds[1])) < 0)
+ PLOG(ERROR) << "close";
}
TEST(MessageLoopTest, FileDescriptorWatcherDoubleStop) {
@@ -1601,8 +1603,10 @@ TEST(MessageLoopTest, FileDescriptorWatcherDoubleStop) {
controller.StopWatchingFileDescriptor();
}
}
- HANDLE_EINTR(close(pipefds[0]));
- HANDLE_EINTR(close(pipefds[1]));
+ if (HANDLE_EINTR(close(pipefds[0])) < 0)
+ PLOG(ERROR) << "close";
+ if (HANDLE_EINTR(close(pipefds[1])) < 0)
+ PLOG(ERROR) << "close";
}
} // namespace
diff --git a/base/message_pump_libevent.cc b/base/message_pump_libevent.cc
index c2390b4..ff4a04a 100644
--- a/base/message_pump_libevent.cc
+++ b/base/message_pump_libevent.cc
@@ -160,10 +160,14 @@ MessagePumpLibevent::~MessagePumpLibevent() {
DCHECK(event_base_);
event_del(wakeup_event_);
delete wakeup_event_;
- if (wakeup_pipe_in_ >= 0)
- HANDLE_EINTR(close(wakeup_pipe_in_));
- if (wakeup_pipe_out_ >= 0)
- HANDLE_EINTR(close(wakeup_pipe_out_));
+ if (wakeup_pipe_in_ >= 0) {
+ if (HANDLE_EINTR(close(wakeup_pipe_in_)) < 0)
+ PLOG(ERROR) << "close";
+ }
+ if (wakeup_pipe_out_ >= 0) {
+ if (HANDLE_EINTR(close(wakeup_pipe_out_)) < 0)
+ PLOG(ERROR) << "close";
+ }
event_base_free(event_base_);
}