diff options
Diffstat (limited to 'sandbox/linux/seccomp-bpf')
-rw-r--r-- | sandbox/linux/seccomp-bpf/sandbox_bpf.cc | 14 | ||||
-rw-r--r-- | sandbox/linux/seccomp-bpf/syscall_unittest.cc | 6 | ||||
-rw-r--r-- | sandbox/linux/seccomp-bpf/trap.cc | 1 |
3 files changed, 10 insertions, 11 deletions
diff --git a/sandbox/linux/seccomp-bpf/sandbox_bpf.cc b/sandbox/linux/seccomp-bpf/sandbox_bpf.cc index 3a4b678..b598d76 100644 --- a/sandbox/linux/seccomp-bpf/sandbox_bpf.cc +++ b/sandbox/linux/seccomp-bpf/sandbox_bpf.cc @@ -104,9 +104,9 @@ bool IsSingleThreaded(int proc_fd) { struct stat sb; int task = -1; if ((task = openat(proc_fd, "self/task", O_RDONLY | O_DIRECTORY)) < 0 || - fstat(task, &sb) != 0 || sb.st_nlink != 3 || HANDLE_EINTR(close(task))) { + fstat(task, &sb) != 0 || sb.st_nlink != 3 || IGNORE_EINTR(close(task))) { if (task >= 0) { - if (HANDLE_EINTR(close(task))) { + if (IGNORE_EINTR(close(task))) { } } return false; @@ -287,7 +287,7 @@ bool Sandbox::RunFunctionInPolicy(void (*code_in_sandbox)(), Die::EnableSimpleExit(); errno = 0; - if (HANDLE_EINTR(close(fds[0]))) { + if (IGNORE_EINTR(close(fds[0]))) { // This call to close() has been failing in strange ways. See // crbug.com/152530. So we only fail in debug mode now. #if !defined(NDEBUG) @@ -309,7 +309,7 @@ bool Sandbox::RunFunctionInPolicy(void (*code_in_sandbox)(), SANDBOX_DIE(NULL); #endif } - if (HANDLE_EINTR(close(fds[1]))) { + if (IGNORE_EINTR(close(fds[1]))) { // This call to close() has been failing in strange ways. See // crbug.com/152530. So we only fail in debug mode now. #if !defined(NDEBUG) @@ -329,7 +329,7 @@ bool Sandbox::RunFunctionInPolicy(void (*code_in_sandbox)(), } // In the parent process. - if (HANDLE_EINTR(close(fds[1]))) { + if (IGNORE_EINTR(close(fds[1]))) { SANDBOX_DIE("close() failed"); } if (sigprocmask(SIG_SETMASK, &old_mask, NULL)) { @@ -357,7 +357,7 @@ bool Sandbox::RunFunctionInPolicy(void (*code_in_sandbox)(), SANDBOX_DIE(buf); } } - if (HANDLE_EINTR(close(fds[0]))) { + if (IGNORE_EINTR(close(fds[0]))) { SANDBOX_DIE("close() failed"); } @@ -451,7 +451,7 @@ void Sandbox::StartSandbox() { // before installing the filters, just in case that our policy denies // close(). if (proc_fd_ >= 0) { - if (HANDLE_EINTR(close(proc_fd_))) { + if (IGNORE_EINTR(close(proc_fd_))) { SANDBOX_DIE("Failed to close file descriptor for /proc"); } proc_fd_ = -1; diff --git a/sandbox/linux/seccomp-bpf/syscall_unittest.cc b/sandbox/linux/seccomp-bpf/syscall_unittest.cc index 0472448..261453b 100644 --- a/sandbox/linux/seccomp-bpf/syscall_unittest.cc +++ b/sandbox/linux/seccomp-bpf/syscall_unittest.cc @@ -64,7 +64,7 @@ TEST(Syscall, TrivialSyscallOneArg) { int new_fd; // Duplicate standard error and close it. ASSERT_GE(new_fd = SandboxSyscall(__NR_dup, 2), 0); - int close_return_value = HANDLE_EINTR(SandboxSyscall(__NR_close, new_fd)); + int close_return_value = IGNORE_EINTR(SandboxSyscall(__NR_close, new_fd)); ASSERT_EQ(close_return_value, 0); } @@ -160,7 +160,7 @@ TEST(Syscall, ComplexSyscallSixArgs) { // Clean up EXPECT_EQ(0, SandboxSyscall(__NR_munmap, addr1, 4096L)); - EXPECT_EQ(0, HANDLE_EINTR(SandboxSyscall(__NR_close, fd))); + EXPECT_EQ(0, IGNORE_EINTR(SandboxSyscall(__NR_close, fd))); // Check that the offset argument (i.e. the sixth argument) is processed // correctly. @@ -193,7 +193,7 @@ TEST(Syscall, ComplexSyscallSixArgs) { // Clean up EXPECT_EQ(0, SandboxSyscall(__NR_munmap, addr2, 8192L)); EXPECT_EQ(0, SandboxSyscall(__NR_munmap, addr3, 4096L)); - EXPECT_EQ(0, HANDLE_EINTR(SandboxSyscall(__NR_close, fd))); + EXPECT_EQ(0, IGNORE_EINTR(SandboxSyscall(__NR_close, fd))); } } // namespace diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc index de701a7..3dcd256 100644 --- a/sandbox/linux/seccomp-bpf/trap.cc +++ b/sandbox/linux/seccomp-bpf/trap.cc @@ -13,7 +13,6 @@ #include <limits> #include "base/logging.h" -#include "base/posix/eintr_wrapper.h" #include "sandbox/linux/seccomp-bpf/codegen.h" #include "sandbox/linux/seccomp-bpf/die.h" #include "sandbox/linux/seccomp-bpf/syscall.h" |