mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
fdm: fdm_poll(): disallow nested calls
This commit is contained in:
parent
338747dc5a
commit
c99c0285dc
1 changed files with 6 additions and 0 deletions
6
fdm.c
6
fdm.c
|
|
@ -142,6 +142,12 @@ fdm_del_no_close(struct fdm *fdm, int fd)
|
||||||
bool
|
bool
|
||||||
fdm_poll(struct fdm *fdm)
|
fdm_poll(struct fdm *fdm)
|
||||||
{
|
{
|
||||||
|
assert(!fdm->is_polling && "nested calls to fdm_poll() not allowed");
|
||||||
|
if (fdm->is_polling) {
|
||||||
|
LOG_ERR("nested calls to fdm_poll() not allowed");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
struct epoll_event events[tll_length(fdm->fds)];
|
struct epoll_event events[tll_length(fdm->fds)];
|
||||||
int ret = epoll_wait(fdm->epoll_fd, events, tll_length(fdm->fds), -1);
|
int ret = epoll_wait(fdm->epoll_fd, events, tll_length(fdm->fds), -1);
|
||||||
if (ret == -1) {
|
if (ret == -1) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue