/[jscoverage]/trunk/http-host.c
ViewVC logotype

Diff of /trunk/http-host.c

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

revision 116 by siliconforks, Sat May 31 21:42:36 2008 UTC revision 118 by siliconforks, Sat May 31 22:32:16 2008 UTC
# Line 27  Line 27 
27  #include "util.h"  #include "util.h"
28    
29  int xgethostbyname(const char * host, struct in_addr * a) {  int xgethostbyname(const char * host, struct in_addr * a) {
30    #ifdef __CYGWIN__
31      /* cygwin's gethostbyname is thread-safe */
32      struct hostent * p = gethostbyname(host);
33      if (p == NULL || p->h_addrtype != AF_INET) {
34        return -1;
35      }
36      *a = *((struct in_addr *) p->h_addr);
37      return 0;
38    #else
39    struct hostent h;    struct hostent h;
40    struct hostent * p;    struct hostent * p;
41    char * buffer;    char * buffer;
# Line 47  Line 56 
56    *a = *((struct in_addr *) p->h_addr);    *a = *((struct in_addr *) p->h_addr);
57    free(buffer);    free(buffer);
58    return 0;    return 0;
59    #endif
60  }  }

Legend:
Removed from v.116  
changed lines
  Added in v.118

  ViewVC Help
Powered by ViewVC 1.1.24