Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fedora(rpmlint): Migrate from deprecated gethostbyname to getaddrinfo
POSIX.1-2008 removes the specifications of gethostbyname(), gethostbyaddr(), and h_errno, recommending the use of getaddrinfo(3) and getnameinfo(3) instead. While it works fine and is unlikely to be removed very soon (though you never know for sure), it's deprecation is likely caused by the fact that it does not support IPv6 and it's not thread-safe. While these are not concerns for uftrace right now (but IPv6 support could be added as a followup), rpmlint warns about it, and it's good to modernize and fix the warning. The Fedora review-tool runs rpmlint on the binary packages and found that the uftrace tool was using gethostbyname, so it eases any future review if we upgrade. The changes are based on existing upgrades for other code and can be cross-checked also with the reviewed code in the URL below. This is only a first step to make the conversion in baby steps. The next step would be to loop over the potentially multiple IPv4 adresses: stackoverflow.com/questions/52727565/client-in-c-use-gethostbyname-or-getaddrinfo An example for IPv4+IPv6 support is shown in answer# 8.
- Loading branch information