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.6 by asvitkine, 2007-01-22T14:48:40Z vs.
Revision 1.7 by gbeauche, 2007-11-03T11:11:42Z

# Line 89 | 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 <        
100 <        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

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines