aboutsummaryrefslogtreecommitdiffhomepage
path: root/experimental
diff options
context:
space:
mode:
authorGravatar humper <humper@google.com>2014-09-09 15:57:33 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-09 15:57:33 -0700
commitd3b6eb246dce5a85c7a17a94e13f8aaca5729111 (patch)
treee141665329e0475ec0caf52f8aa76523feca2a45 /experimental
parentd85ad50b0ed45416f88cce4aa704ae27ca9d6ba8 (diff)
disable webtry seccmp on non-linux build
BUG=skia: R=jcgregorio@google.com Author: humper@google.com Review URL: https://codereview.chromium.org/555993002
Diffstat (limited to 'experimental')
-rw-r--r--experimental/webtry/main.cpp5
-rw-r--r--experimental/webtry/seccomp_bpf.h4
2 files changed, 9 insertions, 0 deletions
diff --git a/experimental/webtry/main.cpp b/experimental/webtry/main.cpp
index 44f8aab70f..b2c06c0d7b 100644
--- a/experimental/webtry/main.cpp
+++ b/experimental/webtry/main.cpp
@@ -23,6 +23,8 @@ DEFINE_string(source, "", "Filename of the source image.");
extern SkBitmap source;
static bool install_syscall_filter() {
+
+#ifndef SK_UNSAFE_BUILD_DESKTOP_ONLY
struct sock_filter filter[] = {
/* Grab the system call number. */
EXAMINE_SYSCALL,
@@ -64,6 +66,9 @@ failed:
fprintf(stderr, "SECCOMP_FILTER is not available. :(\n");
}
return false;
+#else
+ return true;
+#endif /* SK_UNSAFE_BUILD_DESKTOP_ONLY */
}
static void setLimits() {
diff --git a/experimental/webtry/seccomp_bpf.h b/experimental/webtry/seccomp_bpf.h
index 02bf3cff3a..bf72f9aa99 100644
--- a/experimental/webtry/seccomp_bpf.h
+++ b/experimental/webtry/seccomp_bpf.h
@@ -14,6 +14,8 @@
#ifndef _SECCOMP_BPF_H_
#define _SECCOMP_BPF_H_
+#ifndef SK_UNSAFE_BUILD_DESKTOP_ONLY
+
#define _GNU_SOURCE 1
#include <stdio.h>
#include <stddef.h>
@@ -62,4 +64,6 @@ struct seccomp_data {
#define KILL_PROCESS \
BPF_STMT(BPF_RET+BPF_K, SECCOMP_RET_KILL)
+#endif /* SK_UNSAFE_BUILD_DESKTOP_ONLY */
+
#endif /* _SECCOMP_BPF_H_ */