summaryrefslogtreecommitdiff
path: root/sys/compat
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-02-07 16:33:35 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-02-07 16:33:35 +0000
commit589c89834a527468b46758623550f7d5a25178d0 (patch)
tree9be58f6a783b9fc868e1e01c10390d7da450f7a8 /sys/compat
parent5759f6ac45f202510b37976b8e8aa812d3d59384 (diff)
emulate linux connect() braindamage even better -- only do so on async
sockets; pb@fasterix.freenix.org
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linux/linux_socket.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/compat/linux/linux_socket.c b/sys/compat/linux/linux_socket.c
index 43d64c7a8ae..e44dd950242 100644
--- a/sys/compat/linux/linux_socket.c
+++ b/sys/compat/linux/linux_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: linux_socket.c,v 1.9 1997/12/14 20:51:16 deraadt Exp $ */
+/* $OpenBSD: linux_socket.c,v 1.10 1998/02/07 16:33:34 deraadt Exp $ */
/* $NetBSD: linux_socket.c,v 1.14 1996/04/05 00:01:50 christos Exp $ */
/*
@@ -204,10 +204,18 @@ linux_connect(p, uap, retval)
if (error == EISCONN) {
struct sys_getsockopt_args bga;
+ struct sys_fcntl_args fca;
void *status, *statusl;
int stat, statl = sizeof stat;
caddr_t sg;
+ SCARG(&fca, fd) = lca.s;
+ SCARG(&fca, cmd) = F_GETFL;
+ SCARG(&fca, arg) = 0;
+ if (sys_getsockopt(p, &fca, retval) == -1 ||
+ (*retval & O_NONBLOCK) == 0)
+ return error;
+
sg = stackgap_init(p->p_emul);
status = stackgap_alloc(&sg, sizeof stat);
statusl = stackgap_alloc(&sg, sizeof statusl);