Skip to content

Commit

Permalink
cmd/snap-seccomp: Group similar variables together
Browse files Browse the repository at this point in the history
Signed-off-by: Alex Murray <alex.murray@canonical.com>
  • Loading branch information
alexmurray authored and mvo5 committed May 27, 2023
1 parent e5e823b commit 8ad5a73
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cmd/snap-seccomp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,10 @@ func readNumber(token string, syscallName string) (uint64, error) {
return uint64(uint32(value)), nil
}

var errnoOnExplicitDenial int16 = C.EACCES
var (
errnoOnExplicitDenial int16 = C.EACCES
errnoOnImplicitDenial int16 = C.EPERM
)

func parseLine(line string, secFilter *seccomp.ScmpFilter) error {
// ignore comments and empty lines
Expand Down Expand Up @@ -718,8 +721,6 @@ func addSecondaryArches(secFilter *seccomp.ScmpFilter) error {
return nil
}

var errnoOnImplicitDenial int16 = C.EPERM

func preprocess(content []byte) (unrestricted, complain bool) {
scanner := bufio.NewScanner(bytes.NewBuffer(content))
for scanner.Scan() {
Expand Down

0 comments on commit 8ad5a73

Please sign in to comment.