summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
5775c2a)
If the setsockopt() call succeeds but the following bind() fails, we
happily continue to process the address info structure. It seems wrong
to abort the loop if setsockopt() could not enable SO_REUSEADDR. Just
continue in this case.
*/
if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &on,
sizeof(on)) == -1) {
*/
if (setsockopt(sockfd, SOL_SOCKET, SO_REUSEADDR, &on,
sizeof(on)) == -1) {
- ret = -ERRNO_TO_PARA_ERROR(errno);
- PARA_ERROR_LOG("can not set SO_REUSEADDR: %s\n",
- para_strerror(-ret));
- return ret;
}
if (bind(sockfd, ai->ai_addr, ai->ai_addrlen) < 0) {
close(sockfd);
}
if (bind(sockfd, ai->ai_addr, ai->ai_addrlen) < 0) {
close(sockfd);