Module Name:    src
Committed By:   roy
Date:           Mon Mar 19 16:31:24 UTC 2018

Modified Files:
        src/sys/kern: uipc_socket.c

Log Message:
socket: clear error even when peeking

The error has already been reported and it's pointless requiring another
recv(2) call just to clear it.


To generate a diff of this commit:
cvs rdiff -u -r1.259 -r1.260 src/sys/kern/uipc_socket.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/uipc_socket.c
diff -u src/sys/kern/uipc_socket.c:1.259 src/sys/kern/uipc_socket.c:1.260
--- src/sys/kern/uipc_socket.c:1.259	Thu Jan  4 01:42:25 2018
+++ src/sys/kern/uipc_socket.c	Mon Mar 19 16:31:24 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket.c,v 1.259 2018/01/04 01:42:25 christos Exp $	*/
+/*	$NetBSD: uipc_socket.c,v 1.260 2018/03/19 16:31:24 roy Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -71,7 +71,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.259 2018/01/04 01:42:25 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.260 2018/03/19 16:31:24 roy Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1244,8 +1244,7 @@ soreceive(struct socket *so, struct mbuf
 			if (m != NULL)
 				goto dontblock;
 			error = so->so_error;
-			if ((flags & MSG_PEEK) == 0)
-				so->so_error = 0;
+			so->so_error = 0;
 			goto release;
 		}
 		if (so->so_state & SS_CANTRCVMORE) {

Reply via email to