Little code cleanup

This commit is contained in:
sangelovic
2019-10-11 16:04:37 +02:00
parent c6d4d2710f
commit 0f7de608ac
2 changed files with 4 additions and 11 deletions

View File

@ -110,16 +110,11 @@ void Connection::leaveProcessingLoop()
sdbus::IConnection::PollData Connection::getProcessLoopPollData()
{
sdbus::IConnection::PollData pollData;
ISdBus::PollData sdbusPollData;
auto r = iface_->sd_bus_get_poll_data(bus_.get(), &sdbusPollData);
ISdBus::PollData pollData;
auto r = iface_->sd_bus_get_poll_data(bus_.get(), &pollData);
SDBUS_THROW_ERROR_IF(r < 0, "Failed to get bus poll data", -r);
pollData.fd = sdbusPollData.fd;
pollData.events = sdbusPollData.events;
pollData.timeout_usec = sdbusPollData.timeout_usec;
return pollData;
return {pollData.fd, pollData.events, pollData.timeout_usec};
}
const ISdBus& Connection::getSdBusInterface() const
@ -342,11 +337,9 @@ void Connection::joinWithProcessingLoop()
bool Connection::processPendingRequest()
{
auto bus = bus_.get();
assert(bus != nullptr);
int r = iface_->sd_bus_process(bus, nullptr);
SDBUS_THROW_ERROR_IF(r < 0, "Failed to process bus requests", -r);
return r > 0;

View File

@ -57,8 +57,8 @@ namespace sdbus { namespace internal {
void enterProcessingLoop() override;
void enterProcessingLoopAsync() override;
void leaveProcessingLoop() override;
bool processPendingRequest() override;
sdbus::IConnection::PollData getProcessLoopPollData() override;
bool processPendingRequest() override;
void addObjectManager(const std::string& objectPath) override;
SlotPtr addObjectManager(const std::string& objectPath, void* /*dummy*/) override;