]> xenbits.xensource.com Git - people/dariof/libvirt.git/commitdiff
build: skip systemd mock on non-Linux
authorEric Blake <eblake@redhat.com>
Mon, 29 Jul 2013 16:47:09 +0000 (10:47 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 29 Jul 2013 17:28:43 +0000 (11:28 -0600)
A cross-compile to mingw failed:

  CC       virsystemdmock_la-virsystemdmock.lo
../../tests/virsystemdmock.c:29:6: error: 'dbus_connection_set_change_sigpipe' redeclared without dllimport attribute: previous dllimport ignored [-Werror=attributes]
 void dbus_connection_set_change_sigpipe(dbus_bool_t will_modify_sigpipe ATTRIBUTE_UNUSED)
      ^

But when you think about it, systemd is Linux-only, and even our
use of LD_PRELOAD to provide mock syscalls is Linux-only.

* tests/virsystemdmock.c: Avoid compilation outside Linux.

Signed-off-by: Eric Blake <eblake@redhat.com>
tests/virsystemdmock.c

index 1f4413c60120a4628e1fbdff43e3cf4fa5e2c986..b6c36950f85a116dc634de4aaf5a6ff8d5856f3c 100644 (file)
 
 #include <config.h>
 
-#include "internal.h"
+#ifdef __linux__
+# include "internal.h"
 
-#include <stdlib.h>
+# include <stdlib.h>
 
-#include <dbus/dbus.h>
+# include <dbus/dbus.h>
 
 void dbus_connection_set_change_sigpipe(dbus_bool_t will_modify_sigpipe ATTRIBUTE_UNUSED)
 {
@@ -79,3 +80,7 @@ DBusMessage *dbus_connection_send_with_reply_and_block(DBusConnection *connectio
 
     return reply;
 }
+
+#else
+/* Nothing to override on non-__linux__ platforms */
+#endif