This is the mail archive of the
cygwin-cvs@cygwin.com
mailing list for the Cygwin project.
[newlib-cygwin] Cygwin: fix socketpair prototype
- From: Corinna Vinschen <corinna at sourceware dot org>
- To: cygwin-cvs at sourceware dot org
- Date: 9 Mar 2018 13:20:02 -0000
- Subject: [newlib-cygwin] Cygwin: fix socketpair prototype
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=f4a1a186f9f3550b930738d0472bff97728f39e6
commit f4a1a186f9f3550b930738d0472bff97728f39e6
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Fri Mar 9 14:17:39 2018 +0100
Cygwin: fix socketpair prototype
Last parameter is a vector of 2 ints, not a pointer to int
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
winsup/cygwin/include/sys/socket.h | 2 +-
winsup/cygwin/net.cc | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/winsup/cygwin/include/sys/socket.h b/winsup/cygwin/include/sys/socket.h
index e6b92ee..4b61cb0 100644
--- a/winsup/cygwin/include/sys/socket.h
+++ b/winsup/cygwin/include/sys/socket.h
@@ -40,7 +40,7 @@ extern "C"
int shutdown (int, int);
int socket (int __family, int __type, int __protocol);
int sockatmark (int __fd);
- int socketpair (int __domain, int __type, int __protocol, int *__socket_vec);
+ int socketpair (int __domain, int __type, int __protocol, int __fds[2]);
struct servent *getservbyname (const char *__name, const char *__proto);
#endif
diff --git a/winsup/cygwin/net.cc b/winsup/cygwin/net.cc
index 38a53f8..67cd967 100644
--- a/winsup/cygwin/net.cc
+++ b/winsup/cygwin/net.cc
@@ -2271,7 +2271,7 @@ cygwin_bindresvport (int fd, struct sockaddr_in *sin)
/* socketpair: POSIX.1-2001, POSIX.1-2008, 4.4BSD. */
extern "C" int
-socketpair (int af, int type, int protocol, int *sb)
+socketpair (int af, int type, int protocol, int sv[2])
{
int res = -1;
const device *dev;
@@ -2324,8 +2324,8 @@ socketpair (int af, int type, int protocol, int *sb)
set_std_handle (fd_out);
__try
{
- sb[0] = fd_in;
- sb[1] = fd_out;
+ sv[0] = fd_in;
+ sv[1] = fd_out;
res = 0;
}
__except (EFAULT) {}