mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 11:18:43 +00:00
lib: correctly handle EOF when using poll()
Descriptor owner should handle EOF, not thread.c Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
c5761c2b5b
commit
6ccdc60d96
@ -1211,14 +1211,13 @@ check_pollfds(struct thread_master *m, fd_set *readfd, int num)
|
|||||||
ready++;
|
ready++;
|
||||||
|
|
||||||
/* POLLIN / POLLOUT process event */
|
/* POLLIN / POLLOUT process event */
|
||||||
if (m->handler.pfds[i].revents & POLLIN)
|
if (m->handler.pfds[i].revents & (POLLIN | POLLHUP))
|
||||||
thread_process_fds_helper(m, m->read[m->handler.pfds[i].fd], NULL, POLLIN, i);
|
thread_process_fds_helper(m, m->read[m->handler.pfds[i].fd], NULL, POLLIN, i);
|
||||||
if (m->handler.pfds[i].revents & POLLOUT)
|
if (m->handler.pfds[i].revents & POLLOUT)
|
||||||
thread_process_fds_helper(m, m->write[m->handler.pfds[i].fd], NULL, POLLOUT, i);
|
thread_process_fds_helper(m, m->write[m->handler.pfds[i].fd], NULL, POLLOUT, i);
|
||||||
|
|
||||||
/* remove fd from list on POLLNVAL */
|
/* remove fd from list on POLLNVAL */
|
||||||
if (m->handler.pfds[i].revents & POLLNVAL ||
|
if (m->handler.pfds[i].revents & POLLNVAL)
|
||||||
m->handler.pfds[i].revents & POLLHUP)
|
|
||||||
{
|
{
|
||||||
memmove(m->handler.pfds+i,
|
memmove(m->handler.pfds+i,
|
||||||
m->handler.pfds+i+1,
|
m->handler.pfds+i+1,
|
||||||
|
Loading…
Reference in New Issue
Block a user