summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/kern/uipc_syscalls.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 4d8d174..93e8615 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -268,16 +268,15 @@ accept1(td, uap, compat)
error = EINVAL;
goto done;
}
- if ((head->so_state & SS_NBIO) && TAILQ_EMPTY(&head->so_comp)) {
- splx(s);
- error = EWOULDBLOCK;
- goto done;
- }
while (TAILQ_EMPTY(&head->so_comp) && head->so_error == 0) {
if (head->so_state & SS_CANTRCVMORE) {
head->so_error = ECONNABORTED;
break;
}
+ if ((head->so_state & SS_NBIO) != 0) {
+ head->so_error = EWOULDBLOCK;
+ break;
+ }
error = tsleep(&head->so_timeo, PSOCK | PCATCH,
"accept", 0);
if (error) {
OpenPOWER on IntegriCloud