0
0
mirror of https://gitlab.nic.cz/labs/bird.git synced 2024-11-09 20:58:44 +00:00

fixup! Minimalist mainloop implementation

This commit is contained in:
Maria Matejka 2024-09-16 23:10:51 +02:00
parent cdbecfaf86
commit 444454aa66

View File

@ -1629,6 +1629,21 @@ birdloop_minimalist_main(void)
.events = POLLIN,
};
poll(&pfd, 1, poll_tout);
poll_retry:
int rv = poll(&pfd, 1, poll_tout);
if (rv < 0)
{
if (errno == EINTR || errno == EAGAIN)
goto poll_retry;
bug("poll in main birdloop: %m");
}
/* Drain wakeup fd */
if (pfd.revents & POLLIN)
{
THREAD_TRACE(DL_WAKEUP, "Ping received");
ASSERT_DIE(rv == 1);
wakeup_drain(main_birdloop.thread);
}
}
}