summaryrefslogtreecommitdiff
path: root/sys/compat/linux/linux_socket.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-04-25 00:12:46 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-04-25 00:12:46 +0000
commitffa5c75ddacdb2e135ecfa24ff6e9c8652f93e29 (patch)
tree5f9baf786bb9aa2338e872a121355c820976b45b /sys/compat/linux/linux_socket.c
parentd0ca4bc4e5e9dda5309fa76ef00a0cbcc0ed7785 (diff)
Linux has SHUT_RD and SHUT_WR reversed in the ``how'' argument. Presumably
they will fix this sometime, after which this change should be backed out. Pointed out by tchrist@perl.com
Diffstat (limited to 'sys/compat/linux/linux_socket.c')
-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 4944a5d0fcd..7ae3b82e965 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.11 1998/02/10 04:32:41 deraadt Exp $ */
+/* $OpenBSD: linux_socket.c,v 1.12 1998/04/25 00:12:45 millert Exp $ */
/* $NetBSD: linux_socket.c,v 1.14 1996/04/05 00:01:50 christos Exp $ */
/*
@@ -488,6 +488,14 @@ linux_shutdown(p, uap, retval)
if ((error = copyin((caddr_t) uap, (caddr_t) &lsa, sizeof lsa)))
return error;
+ /*
+ * XXX - Linux gets the ``how'' argument wrong. It is reversed!
+ * Hopefully they will fix this someday.
+ */
+ if (lsa.how == SHUT_RD)
+ lsa.how = SHUT_WR;
+ else if (lsa.how == SHUT_WR)
+ lsa.how = SHUT_RD;
SCARG(&bsa, s) = lsa.s;
SCARG(&bsa, how) = lsa.how;