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

Side by Side Diff: base/rand_util_posix.cc

Issue 669055: Add support for running the NaCl plugin in the Linux SUID sandbox (Closed)
Patch Set: Removed tab char; removed change to test (which assumed the NaCl-side change) Created 10 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 unified diff | Download patch
« no previous file with comments | « base/rand_util_c.h ('k') | chrome/browser/renderer_host/render_sandbox_host_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008 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 "base/rand_util.h" 5 #include "base/rand_util.h"
6 #include "base/rand_util_c.h"
6 7
7 #include <errno.h> 8 #include <errno.h>
8 #include <fcntl.h> 9 #include <fcntl.h>
9 #include <unistd.h> 10 #include <unistd.h>
10 11
11 #include "base/file_util.h" 12 #include "base/file_util.h"
12 #include "base/lazy_instance.h" 13 #include "base/lazy_instance.h"
13 #include "base/logging.h" 14 #include "base/logging.h"
14 15
15 namespace { 16 namespace {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 int urandom_fd = g_urandom_fd.Pointer()->fd(); 48 int urandom_fd = g_urandom_fd.Pointer()->fd();
48 bool success = file_util::ReadFromFD(urandom_fd, 49 bool success = file_util::ReadFromFD(urandom_fd,
49 reinterpret_cast<char*>(&number), 50 reinterpret_cast<char*>(&number),
50 sizeof(number)); 51 sizeof(number));
51 CHECK(success); 52 CHECK(success);
52 53
53 return number; 54 return number;
54 } 55 }
55 56
56 } // namespace base 57 } // namespace base
58
59 int GetUrandomFD(void) {
60 return g_urandom_fd.Pointer()->fd();
61 }
OLDNEW
« no previous file with comments | « base/rand_util_c.h ('k') | chrome/browser/renderer_host/render_sandbox_host_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698