small bugfix for std.socket; use reentrant gethostbyname

Downs default_357-line at yahoo.de
Sun Mar 18 13:31:51 PDT 2007


Downs schrieb:
> <snip some false information>
> 
> Looks like I have to apologize. From the manpage:
> 
>  >       The  gethostbyname()  and  gethostbyaddr() functions return the 
> hostent
>  >       structure or a NULL pointer if an error occurs.  On error, the  
> h_errno
> 
> 
> But that is extremely odd, since I have a verified case
> where gethostbyname would return a struct with an
> _invalid_ h_aliases entry. Confusing.
> Perhaps a threading issue? Should gethostbyname usage
> be synchronized? I'll look into that.
>                apologetic --downs
Yup, wrapping the gethostbyname function in a synchronized
block seems to fix this for me. Any reason not to do that?
  --downs


More information about the D.gnu mailing list