summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-06-27 13:58:44 +0000
committerAndrew Tridgell <tridge@samba.org>2001-06-27 13:58:44 +0000
commit5ac133bac731e3f014df35126dd5ecb87837b8a6 (patch)
tree5c13ed0cb3198720ab69446badd2bdaee5b55ca1 /source3
parentc6f647dfd9dff2e9681f084b01cc7267b779f8fd (diff)
downloadsamba-5ac133bac731e3f014df35126dd5ecb87837b8a6.tar.gz
samba-5ac133bac731e3f014df35126dd5ecb87837b8a6.tar.bz2
samba-5ac133bac731e3f014df35126dd5ecb87837b8a6.zip
on sco2 socketpair_tcp needs a bind
(This used to be commit d8e5409ebb883844d9a1abc9840af1809957a444)
Diffstat (limited to 'source3')
-rw-r--r--source3/lib/util_sock.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index d7bef0697e..e3673f011a 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -1158,6 +1158,7 @@ static int socketpair_tcp(int fd[2])
{
int listener;
struct sockaddr sock;
+ struct sockaddr_in sock2;
socklen_t socklen = sizeof(sock);
int connect_done = 0;
@@ -1167,6 +1168,14 @@ static int socketpair_tcp(int fd[2])
if ((listener = socket(PF_INET, SOCK_STREAM, 0)) == -1) goto failed;
+ memset(&sock2, 0, sizeof(sock2));
+#ifdef HAVE_SOCK_SIN_LEN
+ sock2.sin_len = sizeof(sock2);
+#endif
+ sock2.sin_family = PF_INET;
+
+ bind(listener, (struct sockaddr *)&sock2, sizeof(sock2));
+
if (listen(listener, 1) != 0) goto failed;
if (getsockname(listener, &sock, &socklen) != 0) goto failed;