ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/hopm/trunk/src/irc.c
(Generate patch)

Comparing hopm/trunk/src/irc.c (file contents):
Revision 6270 by michael, Mon Jul 13 14:54:11 2015 UTC vs.
Revision 6282 by michael, Tue Jul 14 11:13:25 2015 UTC

# Line 508 | Line 508 | irc_init(void)
508    if (!EmptyString(IRCItem->vhost))
509    {
510      struct addrinfo hints, *res;
511 +    int n;
512  
513      memset(&hints, 0, sizeof(hints));
514  
# Line 515 | Line 516 | irc_init(void)
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines