Bug#754359: trousers: FTBFS on hurd-i386 and kfreebsd-any
Source: trousers
Version: 0.3.13-1
Severity: important
Tags: patch
User: debian-hurd@lists.debian.org
Usertags: hurd, kfreebsd
Hi,
trousers fails to build from source for GNU/Hurd and GNU/kFreeBSD due
to usage of HOST_NAME_MAX, which is not defined on these architectures.
The attached patch fixes this by using _POSIX_HOST_NAME_MAX instead
which is defined, including GNU/Linux. Alternately sysconf(3) could
have been used but a simple test program reveals that -1 is returned on
both Hurd and kFreeBSD.
Thanks!
Index: trousers-0.3.13/src/tspi/tsp_tcsi_param.c
===================================================================
--- trousers-0.3.13.orig/src/tspi/tsp_tcsi_param.c
+++ trousers-0.3.13/src/tspi/tsp_tcsi_param.c
@@ -11,7 +11,7 @@
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
-#include <bits/local_lim.h>
+#include <bits/posix1_lim.h>
#include "trousers/tss.h"
#include "trousers/trousers.h"
#include "trousers_types.h"
@@ -85,7 +85,7 @@ get_tcsd_port(char port_str[TCP_PORT_STR
}
/**
- * Allocates a string with up to HOST_NAME_MAX chars which contains
+ * Allocates a string with up to _POSIX_HOST_NAME_MAX chars which contains
* the hostname extracted from the env var
*/
int
@@ -109,8 +109,8 @@ get_hostname_from_env(char **host_str, u
LogDebug("Environment var %s got value: %s", HOSTNAME_ENV_VAR, tmp_str);
env_len = strlen(tmp_str);
- if (env_len > HOST_NAME_MAX) {
- *len = HOST_NAME_MAX + 1;
+ if (env_len > _POSIX_HOST_NAME_MAX) {
+ *len = _POSIX_HOST_NAME_MAX + 1;
} else {
*len = env_len + 1;
}
Reply to: