summaryrefslogtreecommitdiff
path: root/src/CommonAPI/DBus/DBusMainLoopContext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/CommonAPI/DBus/DBusMainLoopContext.cpp')
-rw-r--r--src/CommonAPI/DBus/DBusMainLoopContext.cpp18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/CommonAPI/DBus/DBusMainLoopContext.cpp b/src/CommonAPI/DBus/DBusMainLoopContext.cpp
index dea1ff9..beaee2c 100644
--- a/src/CommonAPI/DBus/DBusMainLoopContext.cpp
+++ b/src/CommonAPI/DBus/DBusMainLoopContext.cpp
@@ -89,12 +89,28 @@ const pollfd& DBusWatch::getAssociatedFileDescriptor() {
}
void DBusWatch::dispatch(unsigned int eventFlags) {
+#ifdef WIN32
+ unsigned int dbusWatchFlags = 0;
+
+ if (eventFlags & (POLLRDBAND | POLLRDNORM)) {
+ dbusWatchFlags |= DBUS_WATCH_READABLE;
+ }
+ if (eventFlags & POLLWRNORM) {
+ dbusWatchFlags |= DBUS_WATCH_WRITABLE;
+ }
+ if (eventFlags & (POLLERR | POLLNVAL)) {
+ dbusWatchFlags |= DBUS_WATCH_ERROR;
+ }
+ if (eventFlags & POLLHUP) {
+ dbusWatchFlags |= DBUS_WATCH_HANGUP;
+ }
+#else
// Pollflags do not correspond directly to DBus watch flags
unsigned int dbusWatchFlags = (eventFlags & POLLIN) |
((eventFlags & POLLOUT) >> 1) |
((eventFlags & POLLERR) >> 1) |
((eventFlags & POLLHUP) >> 1);
-
+#endif
dbus_watch_handle(libdbusWatch_, dbusWatchFlags);
}