Cleanup: Remove the C version of GetUrandomFD()
I originally added this in a #includable-from-C header so that it
could be #included from NaCl-side code. However, having NaCl #include
Chromium headers is not a clean interface, and this has since been
replaced by runtime dependency injection.
We move the function to a C++ header and put it into a namespace.
Also fix the error return value for UrandomFD() so that it can't be
confused with stdin.
BUG=http://code.google.com/p/nativeclient/issues/detail?id=2655
TEST=build
Review URL: https://chromiumcodereview.appspot.com/10446043
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139537 0039d316-1c4b-4281-b951-d872f2087c98
CrOS-Libchrome-Original-Commit: ead8c1fa606c9a8712c8bb71bdb656f5357c717f
diff --git a/base/rand_util_posix.cc b/base/rand_util_posix.cc
index 6abf5f8..abb404a 100644
--- a/base/rand_util_posix.cc
+++ b/base/rand_util_posix.cc
@@ -1,9 +1,8 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "base/rand_util.h"
-#include "base/rand_util_c.h"
#include <errno.h>
#include <fcntl.h>
@@ -54,8 +53,8 @@
return number;
}
-} // namespace base
-
int GetUrandomFD(void) {
return g_urandom_fd.Pointer()->fd();
}
+
+} // namespace base