| 811 | } |
| 812 | |
| 813 | bool Connection::processPendingEvent() |
| 814 | { |
| 815 | auto *bus = bus_.get(); |
| 816 | assert(bus != nullptr); |
| 817 | |
| 818 | const int r = sdbus_->sd_bus_process(bus, nullptr); |
| 819 | SDBUS_THROW_ERROR_IF(r < 0, "Failed to process bus requests", -r); |
| 820 | |
| 821 | // In correct use of sdbus-c++ API, r can be 0 only when processPendingEvent() |
| 822 | // is called from an external event loop as a reaction to event fd being signalled. |
| 823 | // If there are no more D-Bus messages to process, we know we have to clear event fd. |
| 824 | if (r == 0) |
| 825 | eventFd_.clear(); |
| 826 | |
| 827 | return r > 0; |
| 828 | } |
| 829 | |
| 830 | bool Connection::waitForNextEvent() // NOLINT(misc-no-recursion) |
| 831 | { |
no test coverage detected