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/ldapd | |
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/ldapd')
-rw-r--r-- | usr.sbin/ldapd/control.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/usr.sbin/ldapd/control.c b/usr.sbin/ldapd/control.c index ce25b20f400..05c13b5c609 100644 --- a/usr.sbin/ldapd/control.c +++ b/usr.sbin/ldapd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.13 2016/01/17 08:13:34 landry Exp $ */ +/* $OpenBSD: control.c,v 1.14 2017/01/09 14:04:31 krw Exp $ */ /* * Copyright (c) 2010 Martin Hedenfalk <martin@bzero.se> @@ -163,9 +163,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); } |