Skip to content

Instantly share code, notes, and snippets.

@shulima
Last active November 4, 2015 14:13
Show Gist options
  • Save shulima/a088dcaedce9f0f71f9a to your computer and use it in GitHub Desktop.
Save shulima/a088dcaedce9f0f71f9a to your computer and use it in GitHub Desktop.
patch libguestfs to compile on darwin again
diff --git a/src/launch-libvirt.c b/src/launch-libvirt.c
index 1649884..fae8e5d 100644
--- a/src/launch-libvirt.c
+++ b/src/launch-libvirt.c
@@ -23,12 +23,14 @@
#include <stdarg.h>
#include <stdbool.h>
#include <unistd.h>
+#include <fcntl.h>
#include <grp.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <assert.h>
#include <string.h>
#include <libintl.h>
+#include <sys/un.h> /* sockaddr_un */
#ifdef HAVE_LIBVIRT
#include <libvirt/libvirt.h>
@@ -50,9 +52,6 @@
#include "guestfs_protocol.h"
/* Fixes for Mac OS X */
-#if defined __APPLE__ && defined __MACH__
-#include <sys/un.h>
-#endif
#ifndef SOCK_CLOEXEC
# define SOCK_CLOEXEC O_CLOEXEC
#endif
diff --git a/src/launch-unix.c b/src/launch-unix.c
index 5cce9c1..c796453 100644
--- a/src/launch-unix.c
+++ b/src/launch-unix.c
@@ -22,6 +22,7 @@
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
+#include <sys/un.h> /* sockaddr_un */
#include <string.h>
#include <libintl.h>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment