diff options
author | phk <phk@FreeBSD.org> | 1999-11-16 10:56:05 +0000 |
---|---|---|
committer | phk <phk@FreeBSD.org> | 1999-11-16 10:56:05 +0000 |
commit | 8fca18de89986d6275d0502af100b97274c4bab5 (patch) | |
tree | d8a3cb26e484830479c8386ecba6b7d0157acc06 /sys/kern/uipc_socket.c | |
parent | 520fff788fc8f2154247a6cff986abf634fdbb51 (diff) | |
download | FreeBSD-src-8fca18de89986d6275d0502af100b97274c4bab5.zip FreeBSD-src-8fca18de89986d6275d0502af100b97274c4bab5.tar.gz |
This is a partial commit of the patch from PR 14914:
Alot of the code in sys/kern directly accesses the *Q_HEAD and *Q_ENTRY
structures for list operations. This patch makes all list operations
in sys/kern use the queue(3) macros, rather than directly accessing the
*Q_{HEAD,ENTRY} structures.
This batch of changes compile to the same object files.
Reviewed by: phk
Submitted by: Jake Burkholder <jake@checker.org>
PR: 14914
Diffstat (limited to 'sys/kern/uipc_socket.c')
-rw-r--r-- | sys/kern/uipc_socket.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index 3d15c27..c650a36 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -182,7 +182,7 @@ solisten(so, backlog, p) splx(s); return (error); } - if (so->so_comp.tqh_first == NULL) + if (TAILQ_EMPTY(&so->so_comp)) so->so_options |= SO_ACCEPTCONN; if (backlog < 0 || backlog > somaxconn) backlog = somaxconn; @@ -239,12 +239,13 @@ soclose(so) if (so->so_options & SO_ACCEPTCONN) { struct socket *sp, *sonext; - for (sp = so->so_incomp.tqh_first; sp != NULL; sp = sonext) { - sonext = sp->so_list.tqe_next; + sp = TAILQ_FIRST(&so->so_incomp); + for (; sp != NULL; sp = sonext) { + sonext = TAILQ_NEXT(sp, so_list); (void) soabort(sp); } - for (sp = so->so_comp.tqh_first; sp != NULL; sp = sonext) { - sonext = sp->so_list.tqe_next; + for (sp = TAILQ_FIRST(&so->so_comp); sp != NULL; sp = sonext) { + sonext = TAILQ_NEXT(sp, so_list); /* Dequeue from so_comp since sofree() won't do it */ TAILQ_REMOVE(&so->so_comp, sp, so_list); so->so_qlen--; |