/[svn]/branches/newio/src/s_bsd.c
ViewVC logotype

Diff of /branches/newio/src/s_bsd.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2423 by michael, Tue Jul 23 17:45:56 2013 UTC revision 2424 by michael, Sun Jul 28 17:18:24 2013 UTC
# Line 394  os_accept(int fd, struct irc_ssaddr *add Line 394  os_accept(int fd, struct irc_ssaddr *add
394  }  }
395    
396  int  int
397  os_socket(int family, int sock_type)  os_socket(int family, int sock_type, const char *port_name)
398  {  {
399    int fd;    int fd;
400    
401    fd = socket(family, sock_type, 0);    if ((fd = socket(family, sock_type, 0)) < 0)
402    if (fd < 0)    {
403        report_error(L_ALL, SOCKET_ERROR_MSG, port_name, errno);
404        return -1;
405      }
406    
407      if (fd > MAXCLIENTS - 1)
408      {
409        report_error(L_ALL, CONNLIMIT_ERROR_MSG, port_name, 0);
410        close(fd);
411      return -1;      return -1;
412      }
413    
414    setup_socket(fd);    setup_socket(fd);
415    return fd;    return fd;
416  }  }
# Line 879  connect_inet(struct MaskItem *conf, stru Line 889  connect_inet(struct MaskItem *conf, stru
889    assert(conf);    assert(conf);
890    assert(client_p);    assert(client_p);
891    
892    s_fd(&client_p->localClient->socket) = os_socket(conf->aftype, SOCK_STREAM);    s_fd(&client_p->localClient->socket) = os_socket(conf->aftype, SOCK_STREAM, client_p->name);
893    if (s_fd(&client_p->localClient->socket) < 0)    if (s_fd(&client_p->localClient->socket) < 0)
894      return 0;      return 0;
895    

Legend:
Removed from v.2423  
changed lines
  Added in v.2424

svnadmin@ircd-hybrid.org
ViewVC Help
Powered by ViewVC 1.1.28