summaryrefslogtreecommitdiff
path: root/beos/beos_gui.cpp
diff options
context:
space:
mode:
authorFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-06 00:29:02 +0000
committerFran├žois Revel <mmu_man@netsurf-browser.org>2008-10-06 00:29:02 +0000
commitde531c691aee5200d31e018186f145d0eebb7814 (patch)
tree36a3204b71e7089a3fc33baa2156b91b7aa34023 /beos/beos_gui.cpp
parenteda397e0283673dafb3330dc5d4c3a051c53d3cb (diff)
downloadnetsurf-de531c691aee5200d31e018186f145d0eebb7814.tar.gz
netsurf-de531c691aee5200d31e018186f145d0eebb7814.tar.bz2
Make gui_poll() a little better. Don't check for the event pipe fd if select returned an error.
svn path=/trunk/netsurf/; revision=5492
Diffstat (limited to 'beos/beos_gui.cpp')
-rw-r--r--beos/beos_gui.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/beos/beos_gui.cpp b/beos/beos_gui.cpp
index 3f7f803f3..1e4af4a99 100644
--- a/beos/beos_gui.cpp
+++ b/beos/beos_gui.cpp
@@ -650,15 +650,18 @@ void gui_poll(bool active)
bigtime_t next_schedule = earliest_callback_timeout - system_time();
+ if (!block)
+ next_schedule = 0LL; // now
+ if (block && earliest_callback_timeout != B_INFINITE_TIMEOUT)
+ block = false;
timeout.tv_sec = (long)(next_schedule / 1000000LL);
timeout.tv_usec = (long)(next_schedule % 1000000LL);
LOG(("gui_poll: select(%d, ..., %Ldus", max_fd, next_schedule));
fd_count = select(max_fd, &read_fd_set, &write_fd_set, &exc_fd_set,
- /*block?NULL:*/(
- earliest_callback_timeout == B_INFINITE_TIMEOUT) ? NULL : &timeout);
+ block ? NULL : &timeout);
- if (max_fd > 0 && FD_ISSET(sEventPipe[0], &read_fd_set)) {
+ if (fd_count > 0 && FD_ISSET(sEventPipe[0], &read_fd_set)) {
BMessage *message;
int len = read(sEventPipe[0], &message, sizeof(void *));
LOG(("gui_poll: BMessage ? %d read", len));