ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/slirp/misc.c
(Generate patch)

Comparing BasiliskII/src/slirp/misc.c (file contents):
Revision 1.2 by cebix, 2005-06-30T21:25:26Z vs.
Revision 1.7 by gbeauche, 2007-11-03T11:11:42Z

# Line 6 | Line 6
6   */
7  
8   #define WANT_SYS_IOCTL_H
9 + #include <stdlib.h>
10   #include <slirp.h>
11  
12   u_int curtime, time_fasttimo, last_slowtimo, detach_time;
# Line 88 | Line 89 | void
89   getouraddr()
90   {
91          char buff[256];
92 <        struct hostent *he;
92 >        struct hostent *he = NULL;
93          
94 <        if (gethostname(buff,256) < 0)
95 <           return;
96 <        
97 <        if ((he = gethostbyname(buff)) == NULL)
98 <           return;
99 <        
99 <        our_addr = *(struct in_addr *)he->h_addr;
94 >        if (gethostname(buff,256) == 0)
95 >            he = gethostbyname(buff);
96 >        if (he)
97 >            our_addr = *(struct in_addr *)he->h_addr;
98 >        if (our_addr.s_addr == 0)
99 >            our_addr.s_addr = loopback_addr.s_addr;
100   }
101  
102   #if SIZEOF_CHAR_P == 8
# Line 137 | Line 137 | struct quehead {
137          struct quehead *qh_rlink;
138   };
139  
140 < inline void
140 > void
141   insque(a, b)
142          void *a, *b;
143   {
# Line 150 | Line 150 | insque(a, b)
150          = (struct quehead *)element;
151   }
152  
153 < inline void
153 > void
154   remque(a)
155       void *a;
156   {
# Line 821 | Line 821 | void
821   fd_nonblock(fd)
822          int fd;
823   {
824 < #ifdef FIONBIO
825 <        int opt = 1;
824 > #if defined USE_FIONBIO && defined FIONBIO
825 >        ioctlsockopt_t opt = 1;
826          
827          ioctlsocket(fd, FIONBIO, &opt);
828   #else
# Line 838 | Line 838 | void
838   fd_block(fd)
839          int fd;
840   {
841 < #ifdef FIONBIO
842 <        int opt = 0;
841 > #if defined USE_FIONBIO && defined FIONBIO
842 >        ioctlsockopt_t opt = 0;
843          
844          ioctlsocket(fd, FIONBIO, &opt);
845   #else

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines