Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Fix PR/49150.



details:   https://anonhg.NetBSD.org/src/rev/9d536c3d9388
branches:  trunk
changeset: 778099:9d536c3d9388
user:      matt <matt%NetBSD.org@localhost>
date:      Fri Mar 16 06:47:37 2012 +0000

description:
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.

diffstat:

 sys/kern/uipc_socket.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r bab123f458a9 -r 9d536c3d9388 sys/kern/uipc_socket.c
--- a/sys/kern/uipc_socket.c    Fri Mar 16 06:15:17 2012 +0000
+++ b/sys/kern/uipc_socket.c    Fri Mar 16 06:47:37 2012 +0000
@@ -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 @@
        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);



Home | Main Index | Thread Index | Old Index