summaryrefslogtreecommitdiff
path: root/src/test
diff options
context:
space:
mode:
authorklondike <klondike@xiscosoft.es>2012-11-19 03:43:35 +0100
committerklondike <klondike@xiscosoft.es>2012-11-19 03:43:35 +0100
commite0b2bb0a47754d0887cecbb3f69f6f7bdcd1addb (patch)
tree095e577a148cb0997ce34492ece283561323e43e /src/test
parentd68f6556449d3533bf368baa8631fbbcef125133 (diff)
Check for unshare on the configure and provide an inline replacement when not available
Diffstat (limited to 'src/test')
-rw-r--r--src/test/test-udev.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/test/test-udev.c b/src/test/test-udev.c
index ff3bbbc8d3..8f2aee4a47 100644
--- a/src/test/test-udev.c
+++ b/src/test/test-udev.c
@@ -31,16 +31,13 @@
#include <sched.h>
#include <sys/mount.h>
#include <sys/signalfd.h>
-#include <sys/syscall.h>
#include "udev.h"
-#ifndef SYS_unshare
-#error "libc fails to set SYS_unshare: please file a bug report with eudev"
-#endif
-
-#ifndef unshare
-#define unshare(__X) syscall(SYS_unshare, __X)
+#ifndef HAVE_UNSHARE
+#include <sys/syscall.h>
+/* Provide our own replacement with local reach*/
+static inline int unshare (int x) { return syscall(SYS_unshare, x); }
#endif
void udev_main_log(struct udev *udev, int priority,