From e01706cfb754aca4b2c1b2c15428115df46742be Mon Sep 17 00:00:00 2001 From: Daniel Dunbar Date: Fri, 12 Sep 2014 13:17:52 -0700 Subject: Do not require , which is Linux specific. --- tools/klee-replay/klee-replay.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tools/klee-replay') diff --git a/tools/klee-replay/klee-replay.c b/tools/klee-replay/klee-replay.c index 0ea88fb1..73e2783e 100644 --- a/tools/klee-replay/klee-replay.c +++ b/tools/klee-replay/klee-replay.c @@ -10,6 +10,7 @@ #include "klee-replay.h" #include "klee/Internal/ADT/KTest.h" +#include "klee/Config/config.h" #include #include @@ -23,7 +24,10 @@ #include #include #include + +#ifdef HAVE_SYS_CAPABILITY_H #include +#endif static void __emit_error(const char *msg); @@ -221,6 +225,7 @@ static void run_monitored(char *executable, int argc, char **argv) { } } +#ifdef HAVE_SYS_CAPABILITY_H /* ensure this process has CAP_SYS_CHROOT capability. */ void ensure_capsyschroot(const char *executable) { cap_t caps = cap_get_proc(); // all current capabilities. @@ -237,6 +242,7 @@ void ensure_capsyschroot(const char *executable) { } cap_free(caps); } +#endif static void usage(void) { fprintf(stderr, "Usage: %s [option]... ...\n", progname); @@ -295,9 +301,11 @@ int main(int argc, char** argv) { char* executable = argv[optind]; - /* make sure this process has the CAP_SYS_CHROOT capability. */ + /* make sure this process has the CAP_SYS_CHROOT capability, if possible. */ +#ifdef HAVE_SYS_CAPABILITY_H if (rootdir) ensure_capsyschroot(progname); +#endif /* rootdir should be a prefix of executable's path. */ if (rootdir && strstr(executable, rootdir) != executable) { -- cgit 1.4.1