On Fri, Sep 05, 2014 at 04:30:24PM -0700, Adrian Chadd wrote: > How's this look? >
Malformed. :-P I would prefer: diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c index c6c3152..de72da5 100644 --- a/sys/kern/uipc_socket.c +++ b/sys/kern/uipc_socket.c @@ -3245,6 +3245,7 @@ static int filt_soread(struct knote *kn, long hint) { struct socket *so; + int ret; so = kn->kn_fp->f_data; SOCKBUF_LOCK_ASSERT(&so->so_rcv); @@ -3267,11 +3268,12 @@ filt_soread(struct knote *kn, long hint) CURVNET_SET(so->so_vnet); if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0) - /* This hook returning non-zero indicates an event, not error */ - return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD)); + ret = hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD); + else + ret = 0; CURVNET_RESTORE(); - return (0); + return (ret); } static void But I'm fine either way. > > adrian@testbox1:~/work/freebsd/head/src % svnlite diff sys/kern/ > > Index: sys/kern/uipc_socket.c > > =================================================================== > > --- sys/kern/uipc_socket.c (revision 271182) > > +++ sys/kern/uipc_socket.c (working copy) > > @@ -448,10 +448,12 @@ > > mac_socket_destroy(so); > > #endif > > CURVNET_SET(so->so_vnet); > > - if (V_socket_hhh[HHOOK_SOCKET_CLOSE]->hhh_nhooks > 0) > > + if (V_socket_hhh[HHOOK_SOCKET_CLOSE]->hhh_nhooks > 0) { > > hhook_run_socket(so, NULL, HHOOK_SOCKET_CLOSE); > > - CURVNET_RESTORE(); > > - > > + CURVNET_RESTORE(); > > + } else { > > + CURVNET_RESTORE(); > > + } > > crfree(so->so_cred); > > khelp_destroy_osd(&so->osd); > > sx_destroy(&so->so_snd.sb_sx); > > @@ -3245,6 +3247,7 @@ > > filt_soread(struct knote *kn, long hint) > > { > > struct socket *so; > > + int ret; > > > > so = kn->kn_fp->f_data; > > SOCKBUF_LOCK_ASSERT(&so->so_rcv); > > @@ -3266,11 +3269,15 @@ > > } > > > > CURVNET_SET(so->so_vnet); > > - if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0) > > + if (V_socket_hhh[HHOOK_FILT_SOREAD]->hhh_nhooks > 0) { > > /* This hook returning non-zero indicates an event, not error > */ > > - return (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD)); > > - CURVNET_RESTORE(); > > - > > + ret = (hhook_run_socket(so, NULL, HHOOK_FILT_SOREAD)); > > + CURVNET_RESTORE(); > > + return (ret); > > + } else { > > + CURVNET_RESTORE(); > > + } > > + > > return (0); > > } -- Mateusz Guzik <mjguzik gmail.com> _______________________________________________ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"