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

Side by Side Diff: sandbox/linux/services/proc_util.cc

Issue 1310773006: Update sandbox/linux from upstream (Closed) Base URL: ssh://ssh.github.com/domokit/mojo.git@master
Patch Set: Update to 3909ebfa69566f7374a6900e63cd4d3c73a35378 Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/services/proc_util.h" 5 #include "sandbox/linux/services/proc_util.h"
6 6
7 #include <dirent.h> 7 #include <dirent.h>
8 #include <errno.h> 8 #include <errno.h>
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <string.h> 10 #include <string.h>
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 // No open unmanaged directories found. 104 // No open unmanaged directories found.
105 return false; 105 return false;
106 } 106 }
107 107
108 bool ProcUtil::HasOpenDirectory() { 108 bool ProcUtil::HasOpenDirectory() {
109 base::ScopedFD proc_fd( 109 base::ScopedFD proc_fd(
110 HANDLE_EINTR(open("/proc/", O_DIRECTORY | O_RDONLY | O_CLOEXEC))); 110 HANDLE_EINTR(open("/proc/", O_DIRECTORY | O_RDONLY | O_CLOEXEC)));
111 return HasOpenDirectory(proc_fd.get()); 111 return HasOpenDirectory(proc_fd.get());
112 } 112 }
113 113
114 //static 114 // static
115 base::ScopedFD ProcUtil::OpenProc() { 115 base::ScopedFD ProcUtil::OpenProc() {
116 return OpenDirectory("/proc/"); 116 return OpenDirectory("/proc/");
117 } 117 }
118 118
119 } // namespace sandbox 119 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/linux/services/namespace_sandbox_unittest.cc ('k') | sandbox/linux/services/scoped_process_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698