mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-31 22:45:39 +00:00
use ISC_LIST_FOREACH in more places
use the ISC_LIST_FOREACH pattern in places where lists had been iterated using a different pattern from the typical `for` loop: for example, `while (!ISC_LIST_EMPTY(...))` or `while ((e = ISC_LIST_HEAD(...)) != NULL)`.
This commit is contained in:
@@ -914,20 +914,15 @@ unlock:
|
||||
|
||||
static void
|
||||
clearlistenon(ns_interfacemgr_t *mgr) {
|
||||
ISC_LIST(isc_sockaddr_t) listenon;
|
||||
isc_sockaddr_t *old;
|
||||
|
||||
ISC_LIST_INIT(listenon);
|
||||
ISC_LIST(isc_sockaddr_t) listenon = ISC_LIST_INITIALIZER;
|
||||
|
||||
LOCK(&mgr->lock);
|
||||
ISC_LIST_MOVE(listenon, mgr->listenon);
|
||||
UNLOCK(&mgr->lock);
|
||||
|
||||
old = ISC_LIST_HEAD(listenon);
|
||||
while (old != NULL) {
|
||||
ISC_LIST_FOREACH_SAFE (listenon, old, link) {
|
||||
ISC_LIST_UNLINK(listenon, old, link);
|
||||
isc_mem_put(mgr->mctx, old, sizeof(*old));
|
||||
old = ISC_LIST_HEAD(listenon);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user