kike: don't use HOST_NAME_MAX

FreeBSD doesn't have it.
This commit is contained in:
Přemysl Eric Janouch 2014-08-18 23:02:54 +02:00
parent 371cd5ea21
commit 9fab2fd2bd
1 changed files with 5 additions and 1 deletions

6
kike.c
View File

@ -2890,7 +2890,11 @@ irc_initialize_server_name (struct server_context *ctx, struct error **e)
}
else
{
char hostname[HOST_NAME_MAX];
long host_name_max = sysconf (_SC_HOST_NAME_MAX);
if (host_name_max <= 0)
host_name_max = _POSIX_HOST_NAME_MAX;
char hostname[host_name_max + 1];
if (gethostname (hostname, sizeof hostname))
{
error_set (e, "%s: %s",