diff mbox

[buildfix] oslib-posix: Fix build on FreeBSD

Message ID 1394717279-23406-1-git-send-email-andreas.faerber@web.de
State New
Headers show

Commit Message

Andreas Färber March 13, 2014, 1:27 p.m. UTC
Commit 10f5bff622cad71645e22c027b77ac31e51008ef (util: Split out
exec_dir from os_find_datadir) moved code from os-posix.c to
util/oslib-posix.c but forgot to move a FreeBSD #include alongside,
needed for CTL_KERN among others.

Cc: Fam Zheng <famz@redhat.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Andreas Färber <andreas.faerber@web.de>
---
 os-posix.c         | 4 ----
 util/oslib-posix.c | 4 ++++
 2 files changed, 4 insertions(+), 4 deletions(-)

Comments

Peter Maydell March 13, 2014, 3:35 p.m. UTC | #1
On 13 March 2014 13:27, Andreas Färber <andreas.faerber@web.de> wrote:
> Commit 10f5bff622cad71645e22c027b77ac31e51008ef (util: Split out
> exec_dir from os_find_datadir) moved code from os-posix.c to
> util/oslib-posix.c but forgot to move a FreeBSD #include alongside,
> needed for CTL_KERN among others.
>
> Cc: Fam Zheng <famz@redhat.com>
> Cc: Paolo Bonzini <pbonzini@redhat.com>
> Signed-off-by: Andreas Färber <andreas.faerber@web.de>


Applied to master, thanks.

-- PMM
diff mbox

Patch

diff --git a/os-posix.c b/os-posix.c
index 6187301..cb2a7f7 100644
--- a/os-posix.c
+++ b/os-posix.c
@@ -44,10 +44,6 @@ 
 #include <sys/prctl.h>
 #endif
 
-#ifdef __FreeBSD__
-#include <sys/sysctl.h>
-#endif
-
 static struct passwd *user_pwd;
 static const char *chroot_dir;
 static int daemonize;
diff --git a/util/oslib-posix.c b/util/oslib-posix.c
index c2eeb4f..8e9c770 100644
--- a/util/oslib-posix.c
+++ b/util/oslib-posix.c
@@ -63,6 +63,10 @@  extern int daemon(int, int);
 #include <sys/syscall.h>
 #endif
 
+#ifdef __FreeBSD__
+#include <sys/sysctl.h>
+#endif
+
 int qemu_get_thread_id(void)
 {
 #if defined(__linux__)