svn commit: r271216 - head/sys/kern

Gleb Smirnoff glebius at FreeBSD.org
Sun Sep 7 05:44:15 UTC 2014


Author: glebius
Date: Sun Sep  7 05:44:14 2014
New Revision: 271216
URL: http://svnweb.freebsd.org/changeset/base/271216

Log:
  Fix for r271182.
  
  Submitted by:	mjg
  Pointy hat to:	me, submitter and everyone who urged me to commit

Modified:
  head/sys/kern/uipc_socket.c

Modified: head/sys/kern/uipc_socket.c
==============================================================================
--- head/sys/kern/uipc_socket.c	Sun Sep  7 00:46:57 2014	(r271215)
+++ head/sys/kern/uipc_socket.c	Sun Sep  7 05:44:14 2014	(r271216)
@@ -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


More information about the svn-src-all mailing list