Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2018-02-22 18:25:28 +0300
committerCorinna Vinschen <corinna@vinschen.de>2018-02-22 18:25:28 +0300
commit84c5e0fd3dd263e1e59076e88e65998865d1d9cd (patch)
tree86efa70b1fc0641e573fcfe8042e8a03d2198838 /winsup/cygwin/net.cc
parenta3b5795b06e0fb37b60aa8ba2d6ecf464feacb02 (diff)
Cygwin: make socketpair an AF_LOCAL-only method
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'winsup/cygwin/net.cc')
-rw-r--r--winsup/cygwin/net.cc18
1 files changed, 3 insertions, 15 deletions
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index e849b04cc..7c58b91fb 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -2303,7 +2303,7 @@ socketpair (int af, int type, int protocol, int *sb)
{
int res = -1;
const device *dev;
- fhandler_socket *fh_in, *fh_out;
+ fhandler_socket_local *fh_in, *fh_out;
int flags = type & _SOCK_FLAG_MASK;
type &= ~_SOCK_FLAG_MASK;
@@ -2325,18 +2325,6 @@ socketpair (int af, int type, int protocol, int *sb)
}
dev = type == SOCK_STREAM ? stream_dev : dgram_dev;
break;
-#if 0 /* FIXME: Given neither BSD nor Linux support anything other than AF_LOCAL
- sockets, we deliberately disable AF_INIT socketpairs now and hope for
- the best. */
- case AF_INET:
- if (type != SOCK_STREAM && type != SOCK_DGRAM)
- {
- set_errno (EINVAL);
- goto done;
- }
- dev = type == SOCK_STREAM ? tcp_dev : udp_dev;
- break;
-#endif
default:
set_errno (EAFNOSUPPORT);
goto done;
@@ -2360,8 +2348,8 @@ socketpair (int af, int type, int protocol, int *sb)
goto done;
}
- fh_in = (fhandler_socket *) build_fh_dev (*dev);
- fh_out = (fhandler_socket *) build_fh_dev (*dev);
+ fh_in = reinterpret_cast<fhandler_socket_local *> (build_fh_dev (*dev));
+ fh_out = reinterpret_cast<fhandler_socket_local *> (build_fh_dev (*dev));
if (fh_in && fh_out
&& fh_in->socketpair (af, type, protocol, flags, fh_out) == 0)
{