Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7b7948b1 authored by Bart Van Assche's avatar Bart Van Assche
Browse files

libhealthloop: Use designated initializers



Make the code somewhat easier to read by using designated initializers.
No functionality has been changed.

Bug: 362986353
Change-Id: I707ea158c9c45eeb2662d7b5c1efc9b63f0375cb
Signed-off-by: default avatarBart Van Assche <bvanassche@google.com>
parent 52646191
Loading
Loading
Loading
Loading
+4 −5
Original line number Diff line number Diff line
@@ -63,14 +63,13 @@ int HealthLoop::RegisterEvent(int fd, BoundFunction func, EventWakeup wakeup) {
                                          EventHandler{this, fd, std::move(func)}))
                                  .get();

    struct epoll_event ev;

    ev.events = EPOLLIN;
    struct epoll_event ev = {
        .events = EPOLLIN,
        .data.ptr = reinterpret_cast<void*>(event_handler),
    };

    if (wakeup == EVENT_WAKEUP_FD) ev.events |= EPOLLWAKEUP;

    ev.data.ptr = reinterpret_cast<void*>(event_handler);

    if (epoll_ctl(epollfd_, EPOLL_CTL_ADD, fd, &ev) == -1) {
        KLOG_ERROR(LOG_TAG, "epoll_ctl failed; errno=%d\n", errno);
        return -1;