summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/strace/open.go
diff options
context:
space:
mode:
authorMichael Pratt <mpratt@google.com>2018-12-06 11:42:23 -0800
committerShentubot <shentubot@google.com>2018-12-06 11:43:11 -0800
commit666db00c262c7d6d6359fbaba28e344d015a7823 (patch)
treebe5e9ca85570c04ec5625b79657ab47b0a38aada /pkg/sentry/strace/open.go
parent000fa84a3bb1aebeda235c56545c942d7c29003d (diff)
Convert ValueSet to a map
Unlike FlagSet, order doesn't matter here, so it can simply be a map. PiperOrigin-RevId: 224377910 Change-Id: I15810c698a7f02d8614bf09b59583ab73cba0514
Diffstat (limited to 'pkg/sentry/strace/open.go')
-rw-r--r--pkg/sentry/strace/open.go15
1 files changed, 3 insertions, 12 deletions
diff --git a/pkg/sentry/strace/open.go b/pkg/sentry/strace/open.go
index 5a72a940c..3bf348d7a 100644
--- a/pkg/sentry/strace/open.go
+++ b/pkg/sentry/strace/open.go
@@ -22,18 +22,9 @@ import (
// OpenMode represents the mode to open(2) a file.
var OpenMode = abi.ValueSet{
- {
- Value: syscall.O_RDWR,
- Name: "O_RDWR",
- },
- {
- Value: syscall.O_WRONLY,
- Name: "O_WRONLY",
- },
- {
- Value: syscall.O_RDONLY,
- Name: "O_RDONLY",
- },
+ syscall.O_RDWR: "O_RDWR",
+ syscall.O_WRONLY: "O_WRONLY",
+ syscall.O_RDONLY: "O_RDONLY",
}
// OpenFlagSet is the set of open(2) flags.