]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
build: fix FreeBSD build
authorEric Blake <eblake@redhat.com>
Thu, 2 May 2013 21:30:48 +0000 (15:30 -0600)
committerEric Blake <eblake@redhat.com>
Thu, 2 May 2013 21:41:21 +0000 (15:41 -0600)
Commit 7c9a2d88 cleaned up too many headers; FreeBSD builds
failed due to:

util/virutil.c:556: warning: implicit declaration of function 'canonicalize_file_name'

(Not sure which Linux header leaked this declaration, but gnulib
only guarantees it in stdlib.h)

libvirt.c:956: warning: implicit declaration of function 'virGetUserConfigDirectory'

(Here, a build on Linux was picking up virutil.h indirectly via
one of the conditional driver headers, where that driver was not
being built on my FreeBSD setup)

* src/util/virutil.c (includes): Need <stdlib.h> for
canonicalize_file_name.
* src/libvirt.c (includes): Use "virutil.h" unconditionally,
rather than relying on conditional indirect inclusion.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/libvirt.c
src/util/virutil.c

index 15b37a3c9f5e649f0275212fa33037033917ca19..467f6dde45df3734dd12c379bb538c32d949fb07 100644 (file)
@@ -63,6 +63,7 @@
 #include "viruri.h"
 #include "virthread.h"
 #include "virstring.h"
+#include "virutil.h"
 
 #ifdef WITH_TEST
 # include "test/test_driver.h"
index dc14c15238acb7951132b6b6f6325b1414f93ec5..982d4a3345f77e3c104f5d971fdb4679c2028b1e 100644 (file)
@@ -29,6 +29,7 @@
 #include <dirent.h>
 #include <stdio.h>
 #include <stdarg.h>
+#include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>