ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/svn/branches/newio/src/s_bsd.c
(Generate patch)

Comparing branches/newio/src/s_bsd.c (file contents):
Revision 2423 by michael, Tue Jul 23 17:45:56 2013 UTC vs.
Revision 2424 by michael, Sun Jul 28 17:18:24 2013 UTC

# Line 394 | Line 394 | os_accept(int fd, struct irc_ssaddr *add
394   }
395  
396   int
397 < os_socket(int family, int sock_type)
397 > os_socket(int family, int sock_type, const char *port_name)
398   {
399    int fd;
400  
401 <  fd = socket(family, sock_type, 0);
402 <  if (fd < 0)
401 >  if ((fd = socket(family, sock_type, 0)) < 0)
402 >  {
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;
412 +  }
413 +
414    setup_socket(fd);
415    return fd;
416   }
# Line 879 | Line 889 | connect_inet(struct MaskItem *conf, stru
889    assert(conf);
890    assert(client_p);
891  
892 <  s_fd(&client_p->localClient->socket) = os_socket(conf->aftype, SOCK_STREAM);
892 >  s_fd(&client_p->localClient->socket) = os_socket(conf->aftype, SOCK_STREAM, client_p->name);
893    if (s_fd(&client_p->localClient->socket) < 0)
894      return 0;
895  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines