build: fix FreeBSD build

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>
This commit is contained in:
Eric Blake 2013-05-02 15:30:48 -06:00
parent 25ae3d3015
commit 348ac06133
2 changed files with 2 additions and 0 deletions

View File

@ -63,6 +63,7 @@
#include "viruri.h" #include "viruri.h"
#include "virthread.h" #include "virthread.h"
#include "virstring.h" #include "virstring.h"
#include "virutil.h"
#ifdef WITH_TEST #ifdef WITH_TEST
# include "test/test_driver.h" # include "test/test_driver.h"

View File

@ -29,6 +29,7 @@
#include <dirent.h> #include <dirent.h>
#include <stdio.h> #include <stdio.h>
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <errno.h> #include <errno.h>