Module Name:    src
Committed By:   seanb
Date:           Mon Apr  7 15:35:23 UTC 2014

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

Log Message:
Fix a case where an erroneous EAGAIN was returned out of recvmmsg.
This occured when some, but not all of the mmsg array members
were filled with data from a non-blocking socket.
PR kern/48725


To generate a diff of this commit:
cvs rdiff -u -r1.165 -r1.166 src/sys/kern/uipc_syscalls.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_syscalls.c
diff -u src/sys/kern/uipc_syscalls.c:1.165 src/sys/kern/uipc_syscalls.c:1.166
--- src/sys/kern/uipc_syscalls.c:1.165	Wed Oct  9 20:15:39 2013
+++ src/sys/kern/uipc_syscalls.c	Mon Apr  7 15:35:23 2014
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_syscalls.c,v 1.165 2013/10/09 20:15:39 christos Exp $	*/
+/*	$NetBSD: uipc_syscalls.c,v 1.166 2014/04/07 15:35:23 seanb Exp $	*/
 
 /*-
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -61,7 +61,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.165 2013/10/09 20:15:39 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.166 2014/04/07 15:35:23 seanb Exp $");
 
 #include "opt_pipe.h"
 
@@ -1058,8 +1058,11 @@ sys_recvmmsg(struct lwp *l, const struct
 
 		error = do_sys_recvmsg_so(l, s, so, msg, &from,
 		    msg->msg_control != NULL ? &control : NULL, retval);
-		if (error)
+		if (error) {
+			if (error == EAGAIN && dg > 0)
+				error = 0;
 			break;
+		}
 
 		if (msg->msg_control != NULL)
 			error = copyout_msg_control(l, msg, control);

Reply via email to