mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 12:39:21 +00:00
ldpd: replace hand-rolled 'for' loop with specialized macro
No intentional functional change. Original author: Kenneth R Westerback <krw@openbsd.org> Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
This commit is contained in:
parent
bc6cec21c4
commit
b53f7b86ef
@ -148,9 +148,10 @@ control_connbyfd(int fd)
|
|||||||
{
|
{
|
||||||
struct ctl_conn *c;
|
struct ctl_conn *c;
|
||||||
|
|
||||||
for (c = TAILQ_FIRST(&ctl_conns); c != NULL && c->iev.ibuf.fd != fd;
|
TAILQ_FOREACH(c, &ctl_conns, entry) {
|
||||||
c = TAILQ_NEXT(c, entry))
|
if (c->iev.ibuf.fd == fd)
|
||||||
; /* nothing */
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return (c);
|
return (c);
|
||||||
}
|
}
|
||||||
@ -160,9 +161,10 @@ control_connbypid(pid_t pid)
|
|||||||
{
|
{
|
||||||
struct ctl_conn *c;
|
struct ctl_conn *c;
|
||||||
|
|
||||||
for (c = TAILQ_FIRST(&ctl_conns); c != NULL && c->iev.ibuf.pid != pid;
|
TAILQ_FOREACH(c, &ctl_conns, entry) {
|
||||||
c = TAILQ_NEXT(c, entry))
|
if (c->iev.ibuf.pid == pid)
|
||||||
; /* nothing */
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
return (c);
|
return (c);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user