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

Unified Diff: base/debug/proc_maps_linux.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 | « base/base.gypi ('k') | base/file_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/proc_maps_linux.cc
diff --git a/base/debug/proc_maps_linux.cc b/base/debug/proc_maps_linux.cc
index a956961b7a5a147f4757b09eb898edb260888edd..b7a5862f7472aceb3c8cece84b4e9578641fe19a 100644
--- a/base/debug/proc_maps_linux.cc
+++ b/base/debug/proc_maps_linux.cc
@@ -11,7 +11,6 @@
#endif
#include "base/file_util.h"
-#include "base/files/scoped_file.h"
#include "base/strings/string_split.h"
#if defined(OS_ANDROID)
@@ -46,11 +45,12 @@
// file for details.
const long kReadSize = sysconf(_SC_PAGESIZE);
- base::ScopedFD fd(HANDLE_EINTR(open("/proc/self/maps", O_RDONLY)));
- if (!fd.is_valid()) {
+ int fd = HANDLE_EINTR(open("/proc/self/maps", O_RDONLY));
+ if (fd == -1) {
DPLOG(ERROR) << "Couldn't open /proc/self/maps";
return false;
}
+ file_util::ScopedFD fd_closer(&fd);
proc_maps->clear();
while (true) {
@@ -60,7 +60,7 @@
proc_maps->resize(pos + kReadSize);
void* buffer = &(*proc_maps)[pos];
- ssize_t bytes_read = HANDLE_EINTR(read(fd.get(), buffer, kReadSize));
+ ssize_t bytes_read = HANDLE_EINTR(read(fd, buffer, kReadSize));
if (bytes_read < 0) {
DPLOG(ERROR) << "Couldn't read /proc/self/maps";
proc_maps->clear();
« no previous file with comments | « base/base.gypi ('k') | base/file_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698