Skip to content
Commit 873c84f0 authored by Niclas Zeising's avatar Niclas Zeising
Browse files

Fix build on FreeBSD.

FreeBSD lacks the constant HOST_NAME_MAX, instead using sysconf(3) to
find out the value of the maximum host name length at run time.  Patch
to use this instead of HOST_NAME_MAX.
This brings with it the need to use malloc instead of using a statically
sized buffer for the host name, since the size of the buffer cannot be
known at run time.  Errors from sysconf or malloc just means that the
entire block of code is skipped over (the same way it's skipped if the
call to gethostname() fails), rather than returning any kind of error to
the caller or logging an error message somewhere.
parent f940401b
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment