OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "sandbox/linux/seccomp-bpf/die.h" | 5 #include "sandbox/linux/seccomp-bpf/die.h" |
6 #include "sandbox/linux/seccomp-bpf/errorcode.h" | 6 #include "sandbox/linux/seccomp-bpf/errorcode.h" |
7 | 7 |
8 namespace playground2 { | 8 namespace sandbox { |
9 | 9 |
10 ErrorCode::ErrorCode(int err) { | 10 ErrorCode::ErrorCode(int err) { |
11 switch (err) { | 11 switch (err) { |
12 case ERR_ALLOWED: | 12 case ERR_ALLOWED: |
13 err_ = SECCOMP_RET_ALLOW; | 13 err_ = SECCOMP_RET_ALLOW; |
14 error_type_ = ET_SIMPLE; | 14 error_type_ = ET_SIMPLE; |
15 break; | 15 break; |
16 case ERR_MIN_ERRNO... ERR_MAX_ERRNO: | 16 case ERR_MIN_ERRNO... ERR_MAX_ERRNO: |
17 err_ = SECCOMP_RET_ERRNO + err; | 17 err_ = SECCOMP_RET_ERRNO + err; |
18 error_type_ = ET_SIMPLE; | 18 error_type_ = ET_SIMPLE; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
94 return failed_->LessThan(*err.failed_); | 94 return failed_->LessThan(*err.failed_); |
95 } else { | 95 } else { |
96 return false; | 96 return false; |
97 } | 97 } |
98 } else { | 98 } else { |
99 SANDBOX_DIE("Corrupted ErrorCode"); | 99 SANDBOX_DIE("Corrupted ErrorCode"); |
100 } | 100 } |
101 } | 101 } |
102 } | 102 } |
103 | 103 |
104 } // namespace | 104 } // namespace |
Robert Sesek
2013/12/10 21:52:05
"namespace sandbox"
jln (very slow on Chromium)
2013/12/10 22:01:48
Done.
| |
OLD | NEW |