| 349 | } |
| 350 | |
| 351 | Slot Connection::createSdIoEventSourceSlot(sd_event *event, int fd, int priority) // NOLINT(bugprone-easily-swappable-parameters) |
| 352 | { |
| 353 | sd_event_source *ioEventSource{}; |
| 354 | auto r = sd_event_add_io(event, &ioEventSource, fd, 0, onSdIoEvent, this); |
| 355 | SDBUS_THROW_ERROR_IF(r < 0, "Failed to add io event", -r); |
| 356 | Slot sdIoEventSource{ioEventSource, [](void* source){ deleteSdEventSource(static_cast<sd_event_source*>(source)); }}; |
| 357 | |
| 358 | r = sd_event_source_set_prepare(ioEventSource, onSdEventPrepare); |
| 359 | SDBUS_THROW_ERROR_IF(r < 0, "Failed to set prepare callback for IO event", -r); |
| 360 | |
| 361 | r = sd_event_source_set_priority(ioEventSource, priority); |
| 362 | SDBUS_THROW_ERROR_IF(r < 0, "Failed to set priority for IO event", -r); |
| 363 | |
| 364 | r = sd_event_source_set_description(ioEventSource, "bus-input"); |
| 365 | SDBUS_THROW_ERROR_IF(r < 0, "Failed to set priority for IO event", -r); |
| 366 | |
| 367 | return sdIoEventSource; |
| 368 | } |
| 369 | |
| 370 | Slot Connection::createSdInternalEventSourceSlot(sd_event *event, int fd, int priority) // NOLINT(bugprone-easily-swappable-parameters) |
| 371 | { |
nothing calls this directly
no outgoing calls
no test coverage detected