mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
system/fastboot: remove interest and close epoll
Remove fds from the interest list and close epoll if need. Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
parent
ee33688aca
commit
4b5af957ac
1 changed files with 10 additions and 2 deletions
|
|
@ -1008,7 +1008,7 @@ static void fastboot_command_loop(FAR struct fastboot_ctx_s *ctx,
|
|||
if (epoll_ctl(epfd, EPOLL_CTL_ADD, c->tran_fd[0], &ev[n]) < 0)
|
||||
{
|
||||
fb_err("err add poll %d", c->tran_fd[0]);
|
||||
return;
|
||||
goto epoll_close;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1016,7 +1016,7 @@ static void fastboot_command_loop(FAR struct fastboot_ctx_s *ctx,
|
|||
{
|
||||
if (epoll_wait(epfd, ev, nitems(ev), ctx->left) <= 0)
|
||||
{
|
||||
return;
|
||||
goto epoll_close;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1061,6 +1061,14 @@ static void fastboot_command_loop(FAR struct fastboot_ctx_s *ctx,
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
epoll_close:
|
||||
while (--c >= ctx)
|
||||
{
|
||||
epoll_ctl(epfd, EPOLL_CTL_DEL, c->tran_fd[0], NULL);
|
||||
}
|
||||
|
||||
close(epfd);
|
||||
}
|
||||
|
||||
static void fastboot_publish(FAR struct fastboot_ctx_s *ctx,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue