summaryrefslogtreecommitdiff
path: root/ldpd/control.c
diff options
context:
space:
mode:
Diffstat (limited to 'ldpd/control.c')
-rw-r--r--ldpd/control.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/ldpd/control.c b/ldpd/control.c
index 8a2280be07..0bfe0abc9d 100644
--- a/ldpd/control.c
+++ b/ldpd/control.c
@@ -148,9 +148,10 @@ control_connbyfd(int fd)
{
struct ctl_conn *c;
- for (c = TAILQ_FIRST(&ctl_conns); c != NULL && c->iev.ibuf.fd != fd;
- c = TAILQ_NEXT(c, entry))
- ; /* nothing */
+ TAILQ_FOREACH(c, &ctl_conns, entry) {
+ if (c->iev.ibuf.fd == fd)
+ break;
+ }
return (c);
}
@@ -160,9 +161,10 @@ control_connbypid(pid_t pid)
{
struct ctl_conn *c;
- for (c = TAILQ_FIRST(&ctl_conns); c != NULL && c->iev.ibuf.pid != pid;
- c = TAILQ_NEXT(c, entry))
- ; /* nothing */
+ TAILQ_FOREACH(c, &ctl_conns, entry) {
+ if (c->iev.ibuf.pid == pid)
+ break;
+ }
return (c);
}