diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2017-01-09 14:04:32 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2017-01-09 14:04:32 +0000 |
commit | 14311b17e78a25853fac36210b242ed42215b61f (patch) | |
tree | 645d864c2af99a2d97876a91abe9a475fb54a3c2 /usr.sbin/relayd | |
parent | 1421d3234791e8c1dedc9527273c2d230b7477b9 (diff) |
Replace hand-rolled for(;;) traversal of ctl_conns TAILQ with
TAILQ_FOREACH().
No intentional functional change.
ok reyk@
Diffstat (limited to 'usr.sbin/relayd')
-rw-r--r-- | usr.sbin/relayd/control.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/relayd/control.c b/usr.sbin/relayd/control.c index 57a9a515b16..04bb2c853d4 100644 --- a/usr.sbin/relayd/control.c +++ b/usr.sbin/relayd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.54 2016/09/26 16:25:16 reyk Exp $ */ +/* $OpenBSD: control.c,v 1.55 2017/01/09 14:04:31 krw Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -181,9 +181,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); } |