Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(989)

Unified Diff: base/message_pump_glib.cc

Issue 100225: POSIX: Add a macro for handling EINTR. (Closed)
Patch Set: ... Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/file_util_posix.cc ('k') | base/message_pump_libevent.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/message_pump_glib.cc
diff --git a/base/message_pump_glib.cc b/base/message_pump_glib.cc
index c18bfd3d0b58df10f24a3741e3391a2118f4823b..a7f58edf3d7c11c41724619a9c004ee503dc0944 100644
--- a/base/message_pump_glib.cc
+++ b/base/message_pump_glib.cc
@@ -7,6 +7,7 @@
#include <fcntl.h>
#include <math.h>
+#include "base/eintr_wrappers.h"
#include "base/lazy_instance.h"
#include "base/logging.h"
#include "base/platform_thread.h"
@@ -177,7 +178,7 @@ void MessagePumpForUI::HandleDispatch() {
// poll will tell us whether there was data, so this read shouldn't block.
if (wakeup_gpollfd_.revents & G_IO_IN) {
char msg;
- if (read(wakeup_pipe_read_, &msg, 1) != 1 || msg != '!') {
+ if (HANDLE_EINTR(read(wakeup_pipe_read_, &msg, 1)) != 1 || msg != '!') {
NOTREACHED() << "Error reading from the wakeup pipe.";
}
}
@@ -222,7 +223,7 @@ void MessagePumpForUI::ScheduleWork() {
// variables as we would then need locks all over. This ensures that if
// we are sleeping in a poll that we will wake up.
char msg = '!';
- if (write(wakeup_pipe_write_, &msg, 1) != 1) {
+ if (HANDLE_EINTR(write(wakeup_pipe_write_, &msg, 1)) != 1) {
NOTREACHED() << "Could not write to the UI message loop wakeup pipe!";
}
}
« no previous file with comments | « base/file_util_posix.cc ('k') | base/message_pump_libevent.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698