From 15884890b30bc2c220e8e5c035d8009885b4810d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Fri, 24 Dec 2010 13:54:16 +0100 Subject: [PATCH] gethostname: Provide a fallback for HOST_NAME_MAX. * m4/gethostname.m4 (gl_FUNC_GETHOSTNAME): When neither HOST_NAME_MAX nor MAXHOSTNAMELEN is found in the usual system headers, use 256 instead. Reported by Joachim Schmitz . --- ChangeLog | 8 ++++++++ m4/gethostname.m4 | 10 +++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index fb92f85c1..9e4c4e42c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2010-12-24 Bruno Haible + gethostname: Provide a fallback for HOST_NAME_MAX. + * m4/gethostname.m4 (gl_FUNC_GETHOSTNAME): When neither HOST_NAME_MAX + nor MAXHOSTNAMELEN is found in the usual system headers, use 256 + instead. + Reported by Joachim Schmitz . + +2010-12-24 Bruno Haible + sigaction tests: Allow missing SA_RESETHAND and SA_RESTART. * tests/test-sigaction.c (SA_RESETHAND): Fall back to 0. (SA_RESTART): Likewise. diff --git a/m4/gethostname.m4 b/m4/gethostname.m4 index ef0b43ef9..025c55d59 100644 --- a/m4/gethostname.m4 +++ b/m4/gethostname.m4 @@ -1,5 +1,5 @@ -# gethostname.m4 serial 9 -dnl Copyright (C) 2002, 2008, 2009, 2010 Free Software Foundation, Inc. +# gethostname.m4 serial 10 +dnl Copyright (C) 2002, 2008-2010 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. @@ -83,7 +83,11 @@ lucky #if HAVE_NETDB_H # include #endif -]) +], + [dnl The system does not define MAXHOSTNAMELEN in any of the common + dnl headers. Use a safe fallback. + gl_cv_decl_HOST_NAME_MAX=256 + ]) fi fi ]) -- 2.11.0