Page MenuHomeFreeBSD

Don't ignore return value from gethostname(3)
ClosedPublic

Authored by trasz on Sep 30 2020, 11:33 AM.
Tags
None
Referenced Files
F137085821: D26606.id77749.diff
Fri, Nov 21, 2:57 AM
F137084614: D26606.id77677.diff
Fri, Nov 21, 2:55 AM
F137083986: D26606.id.diff
Fri, Nov 21, 2:53 AM
F137083091: D26606.diff
Fri, Nov 21, 2:51 AM
Unknown Object (File)
Sat, Nov 8, 2:41 AM
Unknown Object (File)
Thu, Nov 6, 12:37 AM
Unknown Object (File)
Sun, Oct 26, 6:39 AM
Unknown Object (File)
Oct 22 2025, 8:23 AM

Details

Summary

Don't ignore return value from gethostname(3). It probably
cannot happen, but it silences down Coverity.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 33899
Build 31101: arc lint + arc unit

Event Timeline

trasz added a reviewer: mav.
trasz added a subscriber: siderop1_netapp.com.

I have feeling it is too aggressive to exit with error here, but since it should not really happen -- OK, will count it as an assertion. May be just assert then?

This revision is now accepted and ready to land.Sep 30 2020, 1:09 PM
In D26606#592597, @mav wrote:

I have feeling it is too aggressive to exit with error here, but since it should not really happen -- OK, will count it as an assertion. May be just assert then?

Not sure how Coverity deals with asserts. Besides, I kind of like the current version.