* Sebastian Andrzej Siewior <sebast...@breakpoint.cc> wrote:
> This patch replaces HOST_NAME_MAX by xgethostname() which is a wrapper
> around malloc() + gethostname() to get a large enough buffer to fit the
> hostname.
> xgethostname.c was stolen from coreutils and slightly changed so it
> works without xreallocte().
> 
> This should fix Debian #751337 where the package does not build KFreeBSD
> due to missing HOST_NAME_MAX.

This may also work as well:

    diff --git a/configure.ac b/configure.ac
    index 80eba33..248044e 100644
    --- a/configure.ac
    +++ b/configure.ac
    @@ -50,6 +50,17 @@ AC_C_INLINE
     AC_TYPE_PID_T
     AC_TYPE_SIZE_T

    +# FreeBSD does not define HOST_NAME_MAX
    +AC_CHECK_DECL(HOST_NAME_MAX,,
    +       [
    +        AC_CHECK_DECL(_POSIX_HOST_NAME_MAX,
    +                      AC_DEFINE(HOST_NAME_MAX, _POSIX_HOST_NAME_MAX, []),
    +                      AC_DEFINE(HOST_NAME_MAX, 256, [Define to 256 if 
neither have HOST_NAME_MAX nor _POSIX_HOST_NAME_MAX]),
    +                      [[#include <limits.h>]])
    +       ],
    +       [[#include <limits.h>]]
    +)
    +
     # Checks for library functions.
     AC_FUNC_MALLOC
     AC_FUNC_MMAP

-- 
Jon


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to