From 3bd66bf4c57c03c2004a8f60234cd60f791c81b9 Mon Sep 17 00:00:00 2001 From: Jens Lorenz Date: Tue, 11 Apr 2017 21:52:38 +0200 Subject: AMUtil: Only add active DBus watch FDs to socket handler Signed-off-by: Jens Lorenz --- AudioManagerUtilities/src/CAmDbusWrapper.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/AudioManagerUtilities/src/CAmDbusWrapper.cpp b/AudioManagerUtilities/src/CAmDbusWrapper.cpp index b87d3a5..1f1d5a6 100644 --- a/AudioManagerUtilities/src/CAmDbusWrapper.cpp +++ b/AudioManagerUtilities/src/CAmDbusWrapper.cpp @@ -293,18 +293,18 @@ dbus_bool_t CAmDbusWrapper::addWatchDelegate(DBusWatch * watch, void* userData) event |= POLLIN; if (flags & DBUS_WATCH_WRITABLE) event |= POLLOUT; - } - logInfo("DBusWrapper::addWatchDelegate entered new watch, fd=", dbus_watch_get_unix_fd(watch), "event flag=", event); - am_Error_e error = mpSocketHandler->addFDPoll(dbus_watch_get_unix_fd(watch), event, &pDbusPrepareCallback, &pDbusFireCallback, &pDbusCheckCallback, &pDbusDispatchCallback, watch, handle); + logInfo("DBusWrapper::addWatchDelegate entered new watch, fd=", dbus_watch_get_unix_fd(watch), "event flag=", event); + am_Error_e error = mpSocketHandler->addFDPoll(dbus_watch_get_unix_fd(watch), event, &pDbusPrepareCallback, &pDbusFireCallback, &pDbusCheckCallback, &pDbusDispatchCallback, watch, handle); - //if everything is alright, add the watch and the handle to our map so we know this relationship - if (error == E_OK && handle != 0) - { - mMapHandleWatch.insert(std::make_pair(watch, handle)); - return (true); + //if everything is alright, add the watch and the handle to our map so we know this relationship + if (error == E_OK && handle != 0) + { + mMapHandleWatch.insert(std::make_pair(watch, handle)); + return (true); + } + logError("DBusWrapper::addWatchDelegate entering watch failed"); } - logError("DBusWrapper::addWatchDelegate entering watch failed"); return (true); } -- cgit v1.2.1