From 4ff7cad5c173774706eddccb3a70ba75a37073dd Mon Sep 17 00:00:00 2001 From: krw Date: Mon, 9 Jan 2017 14:04:31 +0000 Subject: Replace hand-rolled for(;;) traversal of ctl_conns TAILQ with TAILQ_FOREACH(). No intentional functional change. ok reyk@ --- usr.sbin/npppd/npppd/control.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'usr.sbin/npppd') diff --git a/usr.sbin/npppd/npppd/control.c b/usr.sbin/npppd/npppd/control.c index e4374736de0..acb06cab031 100644 --- a/usr.sbin/npppd/npppd/control.c +++ b/usr.sbin/npppd/npppd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.6 2016/03/22 02:27:20 yasuoka Exp $ */ +/* $OpenBSD: control.c,v 1.7 2017/01/09 14:04:31 krw Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -204,9 +204,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); } -- cgit v1.2.3-59-g8ed1b