mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 16:20:08 +00:00
Merge pull request #5145 from Spantik/2796
lib: Clean up the index that is being used for storing FD and events.
This commit is contained in:
commit
11c6d7bd4f
@ -975,6 +975,8 @@ static void thread_cancel_rw(struct thread_master *master, int fd, short state)
|
||||
(master->handler.pfdcount - i - 1)
|
||||
* sizeof(struct pollfd));
|
||||
master->handler.pfdcount--;
|
||||
master->handler.pfds[master->handler.pfdcount].fd = 0;
|
||||
master->handler.pfds[master->handler.pfdcount].events = 0;
|
||||
}
|
||||
|
||||
/* If we have the same pollfd in the copy, perform the same operations,
|
||||
@ -989,6 +991,8 @@ static void thread_cancel_rw(struct thread_master *master, int fd, short state)
|
||||
(master->handler.copycount - i - 1)
|
||||
* sizeof(struct pollfd));
|
||||
master->handler.copycount--;
|
||||
master->handler.copy[master->handler.copycount].fd = 0;
|
||||
master->handler.copy[master->handler.copycount].events = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1292,11 +1296,15 @@ static void thread_process_io(struct thread_master *m, unsigned int num)
|
||||
(m->handler.pfdcount - i - 1)
|
||||
* sizeof(struct pollfd));
|
||||
m->handler.pfdcount--;
|
||||
m->handler.pfds[m->handler.pfdcount].fd = 0;
|
||||
m->handler.pfds[m->handler.pfdcount].events = 0;
|
||||
|
||||
memmove(pfds + i, pfds + i + 1,
|
||||
(m->handler.copycount - i - 1)
|
||||
* sizeof(struct pollfd));
|
||||
m->handler.copycount--;
|
||||
m->handler.copy[m->handler.copycount].fd = 0;
|
||||
m->handler.copy[m->handler.copycount].events = 0;
|
||||
|
||||
i--;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user