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;