1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

tevent: use for() loops instead of while() loops

metze
This commit is contained in:
Stefan Metzmacher 2009-01-12 09:20:57 +01:00
parent 44937c55ff
commit 5d19187d3d

View File

@ -138,34 +138,31 @@ const char **tevent_backend_list(TALLOC_CTX *mem_ctx)
int tevent_common_context_destructor(struct tevent_context *ev) int tevent_common_context_destructor(struct tevent_context *ev)
{ {
struct tevent_fd *fd; struct tevent_fd *fd, *fn;
struct tevent_timer *te; struct tevent_timer *te, *tn;
struct tevent_signal *se; struct tevent_signal *se, *sn;
if (ev->pipe_fde) { if (ev->pipe_fde) {
talloc_free(ev->pipe_fde); talloc_free(ev->pipe_fde);
ev->pipe_fde = NULL; ev->pipe_fde = NULL;
} }
fd = ev->fd_events; for (fd = ev->fd_events; fd; fd = fn) {
while (fd) { fn = fd->next;
fd->event_ctx = NULL; fd->event_ctx = NULL;
DLIST_REMOVE(ev->fd_events, fd); DLIST_REMOVE(ev->fd_events, fd);
fd = ev->fd_events;
} }
te = ev->timer_events; for (te = ev->timer_events; te; te = tn) {
while (te) { tn = te->next;
te->event_ctx = NULL; te->event_ctx = NULL;
DLIST_REMOVE(ev->timer_events, te); DLIST_REMOVE(ev->timer_events, te);
te = ev->timer_events;
} }
se = ev->signal_events; for (se = ev->signal_events; se; se = sn) {
while (se) { sn = se->next;
se->event_ctx = NULL; se->event_ctx = NULL;
DLIST_REMOVE(ev->signal_events, se); DLIST_REMOVE(ev->signal_events, se);
se = ev->signal_events;
} }
return 0; return 0;