From: Simon McVittie Date: Tue, 7 Feb 2012 15:03:56 +0000 (+0000) Subject: Merge branch 'socket-set-33337' X-Git-Tag: dbus-1.5.10~71 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=88498b706a39bbe520f9591d8d52b54fb1f8e378;p=thirdparty%2Fdbus.git Merge branch 'socket-set-33337' Reviewed-by: Will Thompson Bug: https://bugs.freedesktop.org/show_bug.cgi?id=33337 --- 88498b706a39bbe520f9591d8d52b54fb1f8e378 diff --cc dbus/dbus-mainloop.c index 1a046a1f5,e63019fb0..579614de8 --- a/dbus/dbus-mainloop.c +++ b/dbus/dbus-mainloop.c @@@ -65,40 -67,14 +67,13 @@@ struct DBusLoo int timeout_count; int depth; /**< number of recursive runs */ DBusList *need_dispatch; + /** TRUE if we will skip a watch next time because it was OOM; becomes + * FALSE between polling, and dealing with the results of the poll */ + unsigned oom_watch_pending : 1; }; - static short - watch_flags_to_poll_events (unsigned int flags) - { - short events = 0; - - if (flags & DBUS_WATCH_READABLE) - events |= _DBUS_POLLIN; - if (flags & DBUS_WATCH_WRITABLE) - events |= _DBUS_POLLOUT; - - return events; - } - - static unsigned int - watch_flags_from_poll_revents (short revents) - { - unsigned int condition = 0; - - if (revents & _DBUS_POLLIN) - condition |= DBUS_WATCH_READABLE; - if (revents & _DBUS_POLLOUT) - condition |= DBUS_WATCH_WRITABLE; - if (revents & _DBUS_POLLHUP) - condition |= DBUS_WATCH_HANGUP; - if (revents & _DBUS_POLLERR) - condition |= DBUS_WATCH_ERROR; - - return condition; - } - typedef struct { - int refcount; DBusTimeout *timeout; unsigned long last_tv_sec; unsigned long last_tv_usec;