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:
parent
cdbecfaf86
commit
444454aa66
@ -1629,6 +1629,21 @@ birdloop_minimalist_main(void)
|
|||||||
.events = POLLIN,
|
.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);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user