[Libguestfs] [PATCH] launch: add missing headers on Darwin
Pino Toscano
ptoscano at redhat.com
Wed Nov 4 12:37:10 UTC 2015
On Wednesday 04 November 2015 12:05:31 Margaret Lewicka wrote:
> Including sys/un.h for sockaddr_un and sys/fcntl.h for
> O_CLOEXEC/O_NONBLOCK.
> ---
> src/launch-libvirt.c | 1 +
> src/launch-unix.c | 4 ++++
> 2 files changed, 5 insertions(+)
>
> diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c
> index 1649884..ad07210 100644
> --- a/src/launch-libvirt.c
> +++ b/src/launch-libvirt.c
> @@ -52,6 +52,7 @@
> /* Fixes for Mac OS X */
> #if defined __APPLE__ && defined __MACH__
> #include <sys/un.h>
> +#include <sys/fcntl.h>
> #endif
> #ifndef SOCK_CLOEXEC
> # define SOCK_CLOEXEC O_CLOEXEC
> diff --git a/src/launch-unix.c b/src/launch-unix.c
> index 5cce9c1..f57910d 100644
> --- a/src/launch-unix.c
> +++ b/src/launch-unix.c
> @@ -25,6 +25,10 @@
> #include <string.h>
> #include <libintl.h>
>
> +#if defined __APPLE__ && defined __MACH__
> +#include <sys/un.h>
> +#endif
> +
> #include "guestfs.h"
> #include "guestfs-internal.h"
> #include "guestfs_protocol.h"
NACK, these OS-specific blocks are hard to maintain, and it makes no
sense to enclose POSIX headers in them.
Can you please try the attached patch? I see Rich already pushed your
patch, but IMHO that should be reverted and this one should go...
--
Pino Toscano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lib-include-few-more-headers.patch
Type: text/x-patch
Size: 1493 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20151104/91eb7833/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <http://listman.redhat.com/archives/libguestfs/attachments/20151104/91eb7833/attachment.sig>
More information about the Libguestfs
mailing list