Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:redwil:15.4
ihu
0004-use-getaddrinfo.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0004-use-getaddrinfo.patch of Package ihu
diff -aur a/src/Transmitter.cpp b/src/Transmitter.cpp --- a/src/Transmitter.cpp +++ b/src/Transmitter.cpp @@ -132,12 +132,13 @@ if (inet_aton(host.ascii(), &sa.sin_addr) == 0) { - struct hostent *he; + struct addrinfo hints, *res; + hints.ai_family = AF_INET; - he = gethostbyname(host.ascii()); - if (he == NULL) + if (!getaddrinfo(host.ascii(), NULL, &hints, &res)) throw Error(tr("can't resolve ") + host.ascii()); - sa.sin_addr = *(struct in_addr *) he ->h_addr; + sa.sin_addr = ((struct sockaddr_in *)(res->ai_addr))->sin_addr; + freeaddrinfo(res); } int type = 0;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor