Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1155)

Unified Diff: sandbox/linux/seccomp-bpf/sandbox_bpf.cc

Issue 100253002: Don't HANDLE_EINTR(close). Either IGNORE_EINTR(close) or just close. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « rlz/lib/recursive_cross_process_lock_posix.cc ('k') | sandbox/linux/seccomp-bpf/syscall_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp-bpf/sandbox_bpf.cc
diff --git a/sandbox/linux/seccomp-bpf/sandbox_bpf.cc b/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
index 3a4b67886a73dbc6d084291b7cc0933c42c1fb4a..b598d769ba15b6f251a3f724f83c2033ab91d0b8 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;
« no previous file with comments | « rlz/lib/recursive_cross_process_lock_posix.cc ('k') | sandbox/linux/seccomp-bpf/syscall_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698