Source-Changes-HG archive

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

[src/trunk]: src/sys/kern makesocket: set SS_NBIO slightly earlier.



details:   https://anonhg.NetBSD.org/src/rev/5f98a4700a73
branches:  trunk
changeset: 329279:5f98a4700a73
user:      rmind <rmind%NetBSD.org@localhost>
date:      Sat May 17 21:48:48 2014 +0000

description:
makesocket: set SS_NBIO slightly earlier.

diffstat:

 sys/kern/uipc_syscalls.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 0057c8a2e412 -r 5f98a4700a73 sys/kern/uipc_syscalls.c
--- a/sys/kern/uipc_syscalls.c  Sat May 17 21:45:02 2014 +0000
+++ b/sys/kern/uipc_syscalls.c  Sat May 17 21:48:48 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: uipc_syscalls.c,v 1.167 2014/05/17 21:45:02 rmind Exp $        */
+/*     $NetBSD: uipc_syscalls.c,v 1.168 2014/05/17 21:48:48 rmind 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.167 2014/05/17 21:45:02 rmind Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.168 2014/05/17 21:48:48 rmind Exp $");
 
 #include "opt_pipe.h"
 
@@ -417,6 +417,9 @@
        if ((error = socreate(domain, &so, type, proto, l, soo)) != 0) {
                return error;
        }
+       if (flags & SOCK_NONBLOCK) {
+               so->so_state |= SS_NBIO;
+       }
 
        if ((error = fd_allocfile(fp, fd)) != 0) {
                soclose(so);
@@ -429,8 +432,6 @@
        (*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