diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-11-04 13:31:30 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-11-04 13:31:30 +0100 |
commit | c5c44d12073791bb1150445ce48bc57fccbb544d (patch) | |
tree | 9d7704d17cb06f886b0943d1508c9ff08f4b9570 /ipc/chromium/src/base/message_pump_glib.cc | |
parent | a63272b5303b7aef467e974c630f745146fb983a (diff) | |
parent | bbc2206a0fda053a6f5071b457bd209dab9ed268 (diff) | |
download | UXP-c5c44d12073791bb1150445ce48bc57fccbb544d.tar UXP-c5c44d12073791bb1150445ce48bc57fccbb544d.tar.gz UXP-c5c44d12073791bb1150445ce48bc57fccbb544d.tar.lz UXP-c5c44d12073791bb1150445ce48bc57fccbb544d.tar.xz UXP-c5c44d12073791bb1150445ce48bc57fccbb544d.zip |
Merge branch 'master' into certexception-work
Diffstat (limited to 'ipc/chromium/src/base/message_pump_glib.cc')
-rw-r--r-- | ipc/chromium/src/base/message_pump_glib.cc | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/ipc/chromium/src/base/message_pump_glib.cc b/ipc/chromium/src/base/message_pump_glib.cc index 36ebfdd69..24081bd8b 100644 --- a/ipc/chromium/src/base/message_pump_glib.cc +++ b/ipc/chromium/src/base/message_pump_glib.cc @@ -9,6 +9,9 @@ #include <fcntl.h> #include <math.h> +#ifdef OS_SOLARIS +#include <unistd.h> +#endif #include <gtk/gtk.h> #include <glib.h> @@ -131,6 +134,12 @@ MessagePumpForUI::MessagePumpForUI() // Create our wakeup pipe, which is used to flag when work was scheduled. int fds[2]; CHECK(pipe(fds) == 0); +#ifdef OS_SOLARIS + int flags = fcntl(fds[0], F_GETFL,0); + if (flags == -1) + flags = 0; + fcntl(fds[0], F_SETFL, flags | O_NDELAY); +#endif wakeup_pipe_read_ = fds[0]; wakeup_pipe_write_ = fds[1]; wakeup_gpollfd_->fd = wakeup_pipe_read_; @@ -238,11 +247,15 @@ bool MessagePumpForUI::HandleCheck() { // whether there was data, so this read shouldn't block. if (wakeup_gpollfd_->revents & G_IO_IN) { pipe_full_ = false; - +#ifndef OS_SOLARIS char msg; if (HANDLE_EINTR(read(wakeup_pipe_read_, &msg, 1)) != 1 || msg != '!') { NOTREACHED() << "Error reading from the wakeup pipe."; } +#else + char buf[32]; + while (HANDLE_EINTR(read(wakeup_pipe_read_, &buf, 32))); +#endif // Since we ate the message, we need to record that we have more work, // because HandleCheck() may be called without HandleDispatch being called // afterwards. @@ -311,6 +324,10 @@ 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 = '!'; +#ifdef OS_SOLARIS + char buf[32]; + while (HANDLE_EINTR(read(wakeup_pipe_read_, &buf, 32))); +#endif if (HANDLE_EINTR(write(wakeup_pipe_write_, &msg, 1)) != 1) { NOTREACHED() << "Could not write to the UI message loop wakeup pipe!"; } |