From 46fdd02c754b0fe290250b1bfbf4749f4a6639c0 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Mon, 26 Nov 2007 11:40:28 +0000 Subject: [PATCH] Mon Nov 26 11:39:59 UTC 2007 Richard W.M. Jones * configure.in, src/internal.h, src/xml.c: is needed on Cygwin to get PATH_MAX. HOST_NAME_MAX and IF_NAMESIZE defined if not in header files. --- configure.in | 2 +- src/internal.h | 17 +++++++++++++++++ src/xml.c | 3 +++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/configure.in b/configure.in index cf9a3ca725..d13c3f2ab7 100644 --- a/configure.in +++ b/configure.in @@ -64,7 +64,7 @@ dnl Availability of various common functions (non-fatal if missing). AC_CHECK_FUNCS([regexec]) dnl Availability of various common headers (non-fatal if missing). -AC_CHECK_HEADERS(paths.h) +AC_CHECK_HEADERS([paths.h sys/syslimits.h]) dnl Specific dir for HTML output ? AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path], diff --git a/src/internal.h b/src/internal.h index ad42a6a438..3fc111634f 100644 --- a/src/internal.h +++ b/src/internal.h @@ -12,6 +12,23 @@ #include #include #include +#ifdef HAVE_SYS_SYSLIMITS_H +#include +#endif + +/* On architectures which lack these limits, define them (ie. Cygwin). + * Note that the libvirt code should be robust enough to handle the + * case where actual value is longer than these limits (eg. by setting + * length correctly in second argument to gethostname and by always + * using strncpy instead of strcpy). + */ +#ifndef HOST_NAME_MAX +#define HOST_NAME_MAX 256 +#endif + +#ifndef IF_NAMESIZE +#define IF_NAMESIZE 16 +#endif #include "hash.h" #include "libvirt/libvirt.h" diff --git a/src/xml.c b/src/xml.c index 1866ec27a1..b2bee98d12 100644 --- a/src/xml.c +++ b/src/xml.c @@ -8,12 +8,15 @@ * Daniel Veillard */ +#include "config.h" + #include "libvirt/libvirt.h" #include #include #include #include +#include #ifdef WITH_XEN #include #endif -- GitLab