client: fix binding of Unix socket on Solaris
bind() needs to be called before connect(), otherwise it fails with EINVAL.
This commit is contained in:
parent
f444561a10
commit
c062fa2fa9
1 changed files with 5 additions and 5 deletions
10
client.c
10
client.c
|
@ -209,11 +209,6 @@ prepare_socket(union sockaddr_all *addr)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (connect(sock_fd, &addr->sa, addr_len) < 0) {
|
|
||||||
DEBUG_LOG(LOGF_Client, "Could not connect socket : %s", strerror(errno));
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (addr->sa.sa_family == AF_UNIX) {
|
if (addr->sa.sa_family == AF_UNIX) {
|
||||||
struct sockaddr_un sa_un;
|
struct sockaddr_un sa_un;
|
||||||
|
|
||||||
|
@ -242,6 +237,11 @@ prepare_socket(union sockaddr_all *addr)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (connect(sock_fd, &addr->sa, addr_len) < 0) {
|
||||||
|
DEBUG_LOG(LOGF_Client, "Could not connect socket : %s", strerror(errno));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue