dhtrunner: print proper message on bind error

This commit is contained in:
Adrien Béraud committed 2018-12-26 00:58:43 -05:00
1 parent c7604fbb8d
commit d0fdbe5340
1 file changed
+1
+1
View File
@@ -460,6 +460,7 @@ int bindSocket(const SockAddr& addr, SockAddr& bound)
setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY, (const char*)&set, sizeof(set));
int rc = bind(sock, addr.get(), addr.getLength());
if(rc < 0) {
rc = errno;
close(sock);
throw DhtException("Can't bind socket on " + addr.toString() + " " + strerror(rc));
}