Module Name: src
Committed By: christos
Date: Wed Oct 9 18:55:56 UTC 2013
Modified Files:
src/sys/kern: uipc_syscalls.c
Log Message:
PR/48292: Justin Cormack: paccept creates sockets that cannot be made blocking
Reset the socket flags not just the file flags for non-blocking I/O.
XXX: pullup 6
To generate a diff of this commit:
cvs rdiff -u -r1.163 -r1.164 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.163 src/sys/kern/uipc_syscalls.c:1.164
--- src/sys/kern/uipc_syscalls.c:1.163 Mon Oct 7 20:29:24 2013
+++ src/sys/kern/uipc_syscalls.c Wed Oct 9 14:55:56 2013
@@ -1,4 +1,4 @@
-/* $NetBSD: uipc_syscalls.c,v 1.163 2013/10/08 00:29:24 christos Exp $ */
+/* $NetBSD: uipc_syscalls.c,v 1.164 2013/10/09 18:55:56 christos 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.163 2013/10/08 00:29:24 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.164 2013/10/09 18:55:56 christos Exp $");
#include "opt_pipe.h"
@@ -235,8 +235,10 @@ do_sys_accept(struct lwp *l, int sock, s
((flags & SOCK_NOSIGPIPE) ? FNOSIGPIPE : 0);
fp2->f_ops = &socketops;
fp2->f_data = so2;
- if (flags & SOCK_NONBLOCK)
+ if (fp2->f_flag & FNONBLOCK)
so2->so_state |= SS_NBIO;
+ else
+ so2->so_state &= ~SS_NBIO;
error = soaccept(so2, nam);
so2->so_cred = kauth_cred_dup(so->so_cred);
sounlock(so);