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

Comparing ircd-hybrid-7.2/src/s_bsd.c (file contents):
Revision 992 by michael, Mon Aug 17 19:19:16 2009 UTC vs.
Revision 1001 by michael, Sat Aug 29 22:44:44 2009 UTC

# Line 23 | Line 23
23   */
24  
25   #include "stdinc.h"
26 #ifndef _WIN32
26   #include <netinet/in_systm.h>
27   #include <netinet/ip.h>
28   #include <netinet/tcp.h>
30 #endif
29   #include "fdlist.h"
30   #include "s_bsd.h"
31   #include "client.h"
# Line 80 | Line 78 | check_can_use_v6(void)
78    else
79    {
80      ServerInfo.can_use_v6 = 1;
83 #ifdef _WIN32
84    closesocket(v6);
85 #else
81      close(v6);
87 #endif
82    }
83   #else
84    ServerInfo.can_use_v6 = 0;
# Line 100 | Line 94 | check_can_use_v6(void)
94   int
95   get_sockerr(int fd)
96   {
103 #ifndef _WIN32
97    int errtmp = errno;
105 #else
106  int errtmp = WSAGetLastError();
107 #endif
98   #ifdef SO_ERROR
99    int err = 0;
100    socklen_t len = sizeof(err);
# Line 166 | Line 156 | setup_socket(va_list args)
156    setsockopt(fd, IPPROTO_IP, IP_TOS, &opt, sizeof(opt));
157   #endif
158  
169 #ifndef _WIN32
159    fcntl(fd, F_SETFL, fcntl(fd, F_GETFL, 0) | O_NONBLOCK);
171 #endif
160  
161    return NULL;
162   }
# Line 658 | Line 646 | comm_connect_tryconnect(fde_t *fd, void
646    /* Error? */
647    if (retval < 0)
648    {
661 #ifdef _WIN32
662    errno = WSAGetLastError();
663 #endif
649      /*
650       * If we get EISCONN, then we've already connect()ed the socket,
651       * which is a good thing.
# Line 719 | Line 704 | comm_open(fde_t *F, int family, int sock
704     */
705    fd = socket(family, sock_type, proto);
706    if (fd < 0)
722  {
723 #ifdef _WIN32
724    errno = WSAGetLastError();
725 #endif
707      return -1; /* errno will be passed through, yay.. */
727  }
708  
709    execute_callback(setup_socket_cb, fd);
710  
# Line 759 | Line 739 | comm_accept(struct Listener *lptr, struc
739     */
740    newfd = accept(lptr->fd.fd, (struct sockaddr *)pn, (socklen_t *)&addrlen);
741    if (newfd < 0)
762  {
763 #ifdef _WIN32
764    errno = WSAGetLastError();
765 #endif
742      return -1;
767  }
743  
744   #ifdef IPV6
745    remove_ipv6_mapping(pn);

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines