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>
This commit is contained in:
Corinna Vinschen 2018-03-09 14:17:39 +01:00
parent e4c65b2e91
commit f4a1a186f9
2 changed files with 4 additions and 4 deletions

View File

@ -40,7 +40,7 @@ extern "C"
int shutdown (int, int); int shutdown (int, int);
int socket (int __family, int __type, int __protocol); int socket (int __family, int __type, int __protocol);
int sockatmark (int __fd); 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); struct servent *getservbyname (const char *__name, const char *__proto);
#endif #endif

View File

@ -2271,7 +2271,7 @@ cygwin_bindresvport (int fd, struct sockaddr_in *sin)
/* socketpair: POSIX.1-2001, POSIX.1-2008, 4.4BSD. */ /* socketpair: POSIX.1-2001, POSIX.1-2008, 4.4BSD. */
extern "C" int 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; int res = -1;
const device *dev; const device *dev;
@ -2324,8 +2324,8 @@ socketpair (int af, int type, int protocol, int *sb)
set_std_handle (fd_out); set_std_handle (fd_out);
__try __try
{ {
sb[0] = fd_in; sv[0] = fd_in;
sb[1] = fd_out; sv[1] = fd_out;
res = 0; res = 0;
} }
__except (EFAULT) {} __except (EFAULT) {}