summaryrefslogtreecommitdiffstats
path: root/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/linux/seccomp-bpf/sandbox_bpf.cc')
-rw-r--r--sandbox/linux/seccomp-bpf/sandbox_bpf.cc15
1 files changed, 3 insertions, 12 deletions
diff --git a/sandbox/linux/seccomp-bpf/sandbox_bpf.cc b/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
index 49fdd86..f5de6af 100644
--- a/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
+++ b/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
@@ -38,21 +38,11 @@ namespace {
const int kExpectedExitCode = 100;
-template <class T>
-int popcount(T x);
-template <>
-int popcount<unsigned int>(unsigned int x) {
+int popcount(uint32_t x) {
return __builtin_popcount(x);
}
-template <>
-int popcount<unsigned long>(unsigned long x) {
- return __builtin_popcountl(x);
-}
-template <>
-int popcount<unsigned long long>(unsigned long long x) {
- return __builtin_popcountll(x);
-}
+#if !defined(NDEBUG)
void WriteFailedStderrSetupMessage(int out_fd) {
const char* error_string = strerror(errno);
static const char msg[] =
@@ -64,6 +54,7 @@ void WriteFailedStderrSetupMessage(int out_fd) {
HANDLE_EINTR(write(out_fd, "\n", 1))) {
}
}
+#endif // !defined(NDEBUG)
// We define a really simple sandbox policy. It is just good enough for us
// to tell that the sandbox has actually been activated.