Page MenuHomeFreeBSD

systat: remove gethostby*() calls
Needs ReviewPublic

Authored by bses30074_gmail.com on Tue, Jun 25, 2:21 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Jun 27, 5:56 PM
Unknown Object (File)
Thu, Jun 27, 4:34 PM
Unknown Object (File)
Thu, Jun 27, 4:16 PM
Unknown Object (File)
Thu, Jun 27, 3:43 PM
Unknown Object (File)
Thu, Jun 27, 2:55 PM
Subscribers

Details

Reviewers
hrs
lwhsu
Summary
  1. Use getaddrinfo to replace gethostbyname.
  2. Use getnameinfo with NI_NAMEREQD flag to replace gethostbyaddr.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Warnings
SeverityLocationCodeMessage
Warningusr.bin/systat/netstat.c:CHMOD1Invalid Executable
Unit
No Test Coverage
Build Status
Buildable 58338
Build 55226: arc lint + arc unit

Event Timeline

Update according Hiroki advise in D45594

  1. Use "result" instead of "status" name to store the value of getaddrinfo() function. I don't use "error" because it has already error() function in the code.
  2. Use compound literals instead of "hints" variable.

Revise showhosts() for improved efficiency