Index: base/message_pump_libevent.cc |
diff --git a/base/message_pump_libevent.cc b/base/message_pump_libevent.cc |
index f2681f39d1ad74534776c4c0372235ce2c8e8dd9..ad36d4497bb09de6a45816d0e887157d6039001e 100644 |
--- a/base/message_pump_libevent.cc |
+++ b/base/message_pump_libevent.cc |
@@ -7,6 +7,7 @@ |
#include <errno.h> |
#include <fcntl.h> |
+#include "eintr_wrappers.h" |
#include "base/logging.h" |
#include "base/scoped_nsautorelease_pool.h" |
#include "base/scoped_ptr.h" |
@@ -87,7 +88,7 @@ void MessagePumpLibevent::OnWakeup(int socket, short flags, void* context) { |
// Remove and discard the wakeup byte. |
char buf; |
- int nread = read(socket, &buf, 1); |
+ int nread = HANDLE_EINTR(read(socket, &buf, 1)); |
DCHECK_EQ(nread, 1); |
// Tell libevent to break out of inner loop. |
event_base_loopbreak(that->event_base_); |
@@ -272,7 +273,7 @@ void MessagePumpLibevent::Quit() { |
void MessagePumpLibevent::ScheduleWork() { |
// Tell libevent (in a threadsafe way) that it should break out of its loop. |
char buf = 0; |
- int nwrite = write(wakeup_pipe_in_, &buf, 1); |
+ int nwrite = HANDLE_EINTR(write(wakeup_pipe_in_, &buf, 1)); |
DCHECK(nwrite == 1 || errno == EAGAIN) |
<< "[nwrite:" << nwrite << "] [errno:" << errno << "]"; |
} |