508 |
|
if (!EmptyString(IRCItem->vhost)) |
509 |
|
{ |
510 |
|
struct addrinfo hints, *res; |
511 |
+ |
int n; |
512 |
|
|
513 |
|
memset(&hints, 0, sizeof(hints)); |
514 |
|
|
516 |
|
hints.ai_socktype = SOCK_STREAM; |
517 |
|
hints.ai_flags = AI_PASSIVE | AI_NUMERICHOST; |
518 |
|
|
519 |
< |
if (getaddrinfo(IRCItem->vhost, NULL, &hints, &res)) |
519 |
> |
if ((n = getaddrinfo(IRCItem->vhost, NULL, &hints, &res))) |
520 |
|
{ |
521 |
< |
log_printf("IRC -> bind(): %s is an invalid address", IRCItem->vhost); |
521 |
> |
log_printf("IRC -> error binding to %s: %s", IRCItem->vhost, gai_strerror(n)); |
522 |
|
exit(EXIT_FAILURE); |
523 |
|
} |
524 |
|
else if (bind(IRC_FD, res->ai_addr, res->ai_addrlen)) |
525 |
|
{ |
526 |
< |
log_printf("IRC -> bind(): error binding to %s: %s", IRCItem->vhost, strerror(errno)); |
526 |
> |
log_printf("IRC -> error binding to %s: %s", IRCItem->vhost, strerror(errno)); |
527 |
|
exit(EXIT_FAILURE); |
528 |
|
} |
529 |
|
|