Browse Source

Replace hand-rolled for(;;) traversal of ctl_conns TAILQ with

TAILQ_FOREACH().
No intentional functional change.
ok reyk@
OPENBSD_6_1
krw 7 years ago
parent
commit
58841e22f6
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      src/usr.sbin/ntpd/control.c

+ 5
- 4
src/usr.sbin/ntpd/control.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: control.c,v 1.11 2016/09/14 13:20:16 rzalamena Exp $ */
/* $OpenBSD: control.c,v 1.12 2017/01/09 14:04:31 krw Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -142,9 +142,10 @@ control_connbyfd(int fd)
{
struct ctl_conn *c;
for (c = TAILQ_FIRST(&ctl_conns); c != NULL && c->ibuf.fd != fd;
c = TAILQ_NEXT(c, entry))
; /* nothing */
TAILQ_FOREACH(c, &ctl_conns, entry) {
if (c->ibuf.fd == fd)
break;
}
return (c);
}


Loading…
Cancel
Save