qemu-ga: Fix missing environ declaration
Commit 3674838cd05268954bb6473239cd7f700a79bf0f uses the environ global variable, but is relying on environ to be declared somewhere else. This worked for me because on F16 environ is declared in <unistd.h>, but that doesn't happen in OpenBSD for example, causing a build failure. This commit fixes the build error by declaring environ if it hasn't being declared yet. Also fixes a build warning due to a missing <sys/wait.h> include. Signed-off-by: Luiz Capitulino <lcapitulino@redhat.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
This commit is contained in:
parent
8ab1bf120d
commit
2c02cbf6e9
@ -14,12 +14,17 @@
|
|||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
#include <sys/wait.h>
|
||||||
#include "qga/guest-agent-core.h"
|
#include "qga/guest-agent-core.h"
|
||||||
#include "qga-qmp-commands.h"
|
#include "qga-qmp-commands.h"
|
||||||
#include "qerror.h"
|
#include "qerror.h"
|
||||||
#include "qemu-queue.h"
|
#include "qemu-queue.h"
|
||||||
#include "host-utils.h"
|
#include "host-utils.h"
|
||||||
|
|
||||||
|
#ifndef CONFIG_HAS_ENVIRON
|
||||||
|
extern char **environ;
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(__linux__)
|
#if defined(__linux__)
|
||||||
#include <mntent.h>
|
#include <mntent.h>
|
||||||
#include <linux/fs.h>
|
#include <linux/fs.h>
|
||||||
@ -27,7 +32,6 @@
|
|||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <net/if.h>
|
#include <net/if.h>
|
||||||
#include <sys/wait.h>
|
|
||||||
|
|
||||||
#if defined(__linux__) && defined(FIFREEZE)
|
#if defined(__linux__) && defined(FIFREEZE)
|
||||||
#define CONFIG_FSFREEZE
|
#define CONFIG_FSFREEZE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user