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
F151111023: D26606.id.diff
Mon, Apr 6, 3:45 AM
Unknown Object (File)
Mon, Mar 30, 9:19 AM
Unknown Object (File)
Mon, Mar 30, 2:07 AM
Unknown Object (File)
Sun, Mar 29, 5:48 AM
Unknown Object (File)
Sun, Mar 29, 2:12 AM
Unknown Object (File)
Sat, Mar 28, 7:01 PM
Unknown Object (File)
Sat, Mar 28, 6:41 AM
Unknown Object (File)
Thu, Mar 26, 6:41 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 Not Applicable
Unit
Tests Not Applicable

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.