Source-Changes-HG archive

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

[src/netbsd-6-0]: src/sys/kern Pull up following revision(s) (requested by ri...



details:   https://anonhg.NetBSD.org/src/rev/8056efef0584
branches:  netbsd-6-0
changeset: 775214:8056efef0584
user:      snj <snj%NetBSD.org@localhost>
date:      Fri Jul 21 03:55:56 2017 +0000

description:
Pull up following revision(s) (requested by riastradh in ticket #1453):
        sys/kern/uipc_socket.c: revision 1.213
        sys/kern/uipc_syscalls.c: revision 1.160
PR/47569: Valery Ushakov: SOCK_NONBLOCK does not work because it does not
set SS_NBIO.
XXX: there are too many flags that mean the same thing in too many places,
and too many flags that mean the same thing and are different.

diffstat:

 sys/kern/uipc_socket.c   |  6 ++++--
 sys/kern/uipc_syscalls.c |  8 ++++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

diffs (63 lines):

diff -r 030c243e8cb0 -r 8056efef0584 sys/kern/uipc_socket.c
--- a/sys/kern/uipc_socket.c    Fri Jul 14 06:28:22 2017 +0000
+++ b/sys/kern/uipc_socket.c    Fri Jul 21 03:55:56 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_socket.c,v 1.209.2.1.4.2 2013/11/25 08:27:01 bouyer Exp $ */
+/*     $NetBSD: uipc_socket.c,v 1.209.2.1.4.3 2017/07/21 03:55:56 snj 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.2.1.4.2 2013/11/25 08:27:01 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_socket.c,v 1.209.2.1.4.3 2017/07/21 03:55:56 snj Exp $");
 
 #include "opt_compat_netbsd.h"
 #include "opt_sock_counters.h"
@@ -585,6 +585,8 @@
                fp->f_data = so;
                fd_affix(curproc, fp, fd);
                *fdout = fd;
+               if (flags & SOCK_NONBLOCK)
+                       so->so_state |= SS_NBIO;
        }
        return error;
 }
diff -r 030c243e8cb0 -r 8056efef0584 sys/kern/uipc_syscalls.c
--- a/sys/kern/uipc_syscalls.c  Fri Jul 14 06:28:22 2017 +0000
+++ b/sys/kern/uipc_syscalls.c  Fri Jul 21 03:55:56 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_syscalls.c,v 1.154.2.1.4.2 2013/12/14 19:37:02 bouyer Exp $       */
+/*     $NetBSD: uipc_syscalls.c,v 1.154.2.1.4.3 2017/07/21 03:55:56 snj 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.154.2.1.4.2 2013/12/14 19:37:02 bouyer Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.154.2.1.4.3 2017/07/21 03:55:56 snj Exp $");
 
 #include "opt_pipe.h"
 
@@ -235,6 +235,8 @@
            ((flags & SOCK_NOSIGPIPE) ? FNOSIGPIPE : 0);
        fp2->f_ops = &socketops;
        fp2->f_data = so2;
+       if (flags & SOCK_NONBLOCK)
+               so2->so_state |= SS_NBIO;
        error = soaccept(so2, nam);
        so2->so_cred = kauth_cred_dup(so->so_cred);
        sounlock(so);
@@ -425,6 +427,8 @@
        (*fp)->f_type = DTYPE_SOCKET;
        (*fp)->f_ops = &socketops;
        (*fp)->f_data = so;
+       if (flags & SOCK_NONBLOCK)
+               so->so_state |= SS_NBIO;
        return 0;
 }
 



Home | Main Index | Thread Index | Old Index