Skip to content

Commit 7e016e4

Browse files
committed
Fix for conditional build
This fixes the conditional build for Linux and hopefully also works for the operating systems that don't support seccomp.
1 parent 273d21d commit 7e016e4

File tree

3 files changed

+7
-13
lines changed

3 files changed

+7
-13
lines changed

bscdiff.go

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,6 @@ import (
1515
"sort"
1616
)
1717

18-
func init() {
19-
// The syscall restriciton is only available for Linux right now via
20-
// seccomp.
21-
applySyscallRestrictions()
22-
}
23-
2418
type searchResult struct {
2519
line int
2620
match []string

syscall-restrictions-linux.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build linux
12
// +build linux
23

34
package main
@@ -9,6 +10,12 @@ import (
910
libseccomp "github.com/seccomp/libseccomp-golang"
1011
)
1112

13+
func init() {
14+
// The syscall restriciton is only available for Linux right now via
15+
// seccomp.
16+
applySyscallRestrictions()
17+
}
18+
1219
func applySyscallRestrictions() {
1320

1421
var syscalls = []string{"read", "write", "close", "fstat", "mmap",

syscall-restrictions-not-implemented.go

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)