]> xenbits.xensource.com Git - libvirt.git/commitdiff
Mon Nov 26 11:39:59 UTC 2007 Richard W.M. Jones <rjones@redhat.com>
authorRichard W.M. Jones <rjones@redhat.com>
Mon, 26 Nov 2007 11:40:28 +0000 (11:40 +0000)
committerRichard W.M. Jones <rjones@redhat.com>
Mon, 26 Nov 2007 11:40:28 +0000 (11:40 +0000)
* configure.in, src/internal.h, src/xml.c: <sys/syslimits.h>
  is needed on Cygwin to get PATH_MAX.  HOST_NAME_MAX and
  IF_NAMESIZE defined if not in header files.

configure.in
src/internal.h
src/xml.c

index cf9a3ca7252b2d8a48ea892e131a1095a6d8a29d..d13c3f2ab794304279dc1b085ce5bf43ef8ecc6b 100644 (file)
@@ -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],
index ad42a6a438a9cf5b15333af3712f83db8055394b..3fc111634ffda37ae6f8a8b26e5fcbde226641fe 100644 (file)
 #include <netinet/in.h>
 #include <netinet/tcp.h>
 #include <libxml/threads.h>
+#ifdef HAVE_SYS_SYSLIMITS_H
+#include <sys/syslimits.h>
+#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"
index 1866ec27a1207ee5e6ea25b1e3e3f3e3509f850e..b2bee98d127dffa812d01b8627511d762592368e 100644 (file)
--- a/src/xml.c
+++ b/src/xml.c
@@ -8,12 +8,15 @@
  * Daniel Veillard <veillard@redhat.com>
  */
 
+#include "config.h"
+
 #include "libvirt/libvirt.h"
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdarg.h>
+#include <limits.h>
 #ifdef WITH_XEN
 #include <xs.h>
 #endif