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

Unified Diff: sandbox/linux/services/yama.cc

Issue 197873014: Revert of Implement ScopedFD in terms of ScopedGeneric. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 months 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 | « sandbox/linux/services/scoped_process_unittest.cc ('k') | tools/android/memdump/memdump.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/services/yama.cc
diff --git a/sandbox/linux/services/yama.cc b/sandbox/linux/services/yama.cc
index 39ac079f1ea39e54b6d282cf37b9b9942a8d9e52..efb261c561b5aa5d5207b11d095c4ee60f3812db 100644
--- a/sandbox/linux/services/yama.cc
+++ b/sandbox/linux/services/yama.cc
@@ -12,7 +12,6 @@
#include "base/basictypes.h"
#include "base/file_util.h"
-#include "base/files/scoped_file.h"
#include "base/logging.h"
#include "base/posix/eintr_wrapper.h"
@@ -79,17 +78,18 @@
static const char kPtraceScopePath[] = "/proc/sys/kernel/yama/ptrace_scope";
- base::ScopedFD yama_scope(open(kPtraceScopePath, O_RDONLY));
+ int yama_scope = open(kPtraceScopePath, O_RDONLY);
- if (!yama_scope.is_valid()) {
+ if (yama_scope < 0) {
const int open_errno = errno;
DCHECK(ENOENT == open_errno);
// The status is known, yama is not present.
return STATUS_KNOWN;
}
+ file_util::ScopedFDCloser yama_scope_closer(&yama_scope);
char yama_scope_value = 0;
- ssize_t num_read = read(yama_scope.get(), &yama_scope_value, 1);
+ ssize_t num_read = read(yama_scope, &yama_scope_value, 1);
PCHECK(1 == num_read);
switch (yama_scope_value) {
« no previous file with comments | « sandbox/linux/services/scoped_process_unittest.cc ('k') | tools/android/memdump/memdump.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698