Patchwork [12/24] qga/channel-posix.c: include headers it needs

login
register
mail settings
Submitter Eduardo Habkost
Date Nov. 9, 2012, 2:56 p.m.
Message ID <1352473012-20500-13-git-send-email-ehabkost@redhat.com>
Download mbox | patch
Permalink /patch/198089/
State New
Headers show

Comments

Eduardo Habkost - Nov. 9, 2012, 2:56 p.m.
Include:
 - <errno.h> for errno
 - <unistd.h> & <fcntl.h> for fcntl()
 - "qemu-stdio.h" for qemu_open()

Some of those headers were probably being included by accident because
some other headers were including qemu-common.h, but those headers
should eventually stop including qemu-common.h.

Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
---
 qga/channel-posix.c | 4 ++++
 1 file changed, 4 insertions(+)
Andreas Färber - Nov. 14, 2012, 4:14 p.m.
Am 09.11.2012 15:56, schrieb Eduardo Habkost:
> Include:
>  - <errno.h> for errno
>  - <unistd.h> & <fcntl.h> for fcntl()
>  - "qemu-stdio.h" for qemu_open()
> 
> Some of those headers were probably being included by accident because
> some other headers were including qemu-common.h, but those headers
> should eventually stop including qemu-common.h.
> 
> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
> ---
>  qga/channel-posix.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/qga/channel-posix.c b/qga/channel-posix.c
> index d152827..2a68451 100644
> --- a/qga/channel-posix.c
> +++ b/qga/channel-posix.c
> @@ -1,5 +1,9 @@
>  #include <glib.h>
>  #include <termios.h>
> +#include <errno.h>
> +#include <unistd.h>
> +#include <fcntl.h>
> +#include "qemu-stdio.h"
>  #include "qemu_socket.h"
>  #include "qga/channel.h"
>  

Since the qemu-stdio.h patch was under debate, I've posted a patch
moving qemu_open() and its companion qemu_close() to osdep.h as
suggested by Igor - uses osdep.h here works fine then. Rest looks good.

Andreas

Patch

diff --git a/qga/channel-posix.c b/qga/channel-posix.c
index d152827..2a68451 100644
--- a/qga/channel-posix.c
+++ b/qga/channel-posix.c
@@ -1,5 +1,9 @@ 
 #include <glib.h>
 #include <termios.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include "qemu-stdio.h"
 #include "qemu_socket.h"
 #include "qga/channel.h"