Module Name:    src
Committed By:   matt
Date:           Fri Mar 16 06:47:37 UTC 2012

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

Log Message:
Fix PR/49150.
Make listen(2) match the opengroup specification for what what errno to
return if the socket is connected when a listen(2) is attempted.


To generate a diff of this commit:
cvs rdiff -u -r1.209 -r1.210 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.209 src/sys/kern/uipc_socket.c:1.210
--- src/sys/kern/uipc_socket.c:1.209	Wed Feb  1 02:27:23 2012
+++ src/sys/kern/uipc_socket.c	Fri Mar 16 06:47:37 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: uipc_socket.c,v 1.209 2012/02/01 02:27:23 matt Exp $	*/
+/*	$NetBSD: uipc_socket.c,v 1.210 2012/03/16 06:47:37 matt Exp $	*/
 
 /*-
  * Copyright (c) 2002, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.209 2012/02/01 02:27:23 matt Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.210 2012/03/16 06:47:37 matt Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_sock_counters.h"
@@ -622,7 +622,7 @@ solisten(struct socket *so, int backlog,
 	if ((so->so_state & (SS_ISCONNECTED | SS_ISCONNECTING | 
 	    SS_ISDISCONNECTING)) != 0) {
 	    	sounlock(so);
-		return (EOPNOTSUPP);
+		return (EINVAL);
 	}
 	error = (*so->so_proto->pr_usrreq)(so, PRU_LISTEN, NULL,
 	    NULL, NULL, l);

Reply via email to