diff options
author | ru <ru@FreeBSD.org> | 2005-11-09 13:29:16 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2005-11-09 13:29:16 +0000 |
commit | dcace5669d81e83aea7a22539593b0f158eb224c (patch) | |
tree | 54d0f8642eec5f374a08d8a2b18c53a66b4ba269 /sys/kern/uipc_proto.c | |
parent | eba5310ce5792d913219b571cd4890c26fea82d8 (diff) | |
download | FreeBSD-src-dcace5669d81e83aea7a22539593b0f158eb224c.zip FreeBSD-src-dcace5669d81e83aea7a22539593b0f158eb224c.tar.gz |
Use sparse initializers for "struct domain" and "struct protosw",
so they are easier to follow for the human being.
Diffstat (limited to 'sys/kern/uipc_proto.c')
-rw-r--r-- | sys/kern/uipc_proto.c | 42 |
1 files changed, 24 insertions, 18 deletions
diff --git a/sys/kern/uipc_proto.c b/sys/kern/uipc_proto.c index 68be294..d15e993 100644 --- a/sys/kern/uipc_proto.c +++ b/sys/kern/uipc_proto.c @@ -48,29 +48,35 @@ __FBSDID("$FreeBSD$"); */ static struct protosw localsw[] = { -{ SOCK_STREAM, &localdomain, 0, PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS, - 0, 0, 0, &uipc_ctloutput, - 0, - 0, 0, 0, 0, - &uipc_usrreqs +{ + .pr_type = SOCK_STREAM, + .pr_domain = &localdomain, + .pr_flags = PR_CONNREQUIRED|PR_WANTRCVD|PR_RIGHTS, + .pr_ctloutput = &uipc_ctloutput, + .pr_usrreqs = &uipc_usrreqs }, -{ SOCK_DGRAM, &localdomain, 0, PR_ATOMIC|PR_ADDR|PR_RIGHTS, - 0, 0, 0, 0, - 0, - 0, 0, 0, 0, - &uipc_usrreqs +{ + .pr_type = SOCK_DGRAM, + .pr_domain = &localdomain, + .pr_flags = PR_ATOMIC|PR_ADDR|PR_RIGHTS, + .pr_usrreqs = &uipc_usrreqs }, -{ 0, 0, 0, 0, - 0, 0, raw_ctlinput, 0, - 0, - raw_init, 0, 0, 0, - &raw_usrreqs +{ + .pr_ctlinput = raw_ctlinput, + .pr_init = raw_init, + .pr_usrreqs = &raw_usrreqs } }; -struct domain localdomain = - { AF_LOCAL, "local", unp_init, unp_externalize, unp_dispose, - localsw, &localsw[sizeof(localsw)/sizeof(localsw[0])] }; +struct domain localdomain = { + .dom_family = AF_LOCAL, + .dom_name = "local", + .dom_init = unp_init, + .dom_externalize = unp_externalize, + .dom_dispose = unp_dispose, + .dom_protosw = localsw, + .dom_protoswNPROTOSW = &localsw[sizeof(localsw)/sizeof(localsw[0])] +}; DOMAIN_SET(local); SYSCTL_NODE(_net, PF_LOCAL, local, CTLFLAG_RW, 0, "Local domain"); |