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

Unified Diff: base/rand_util_posix.cc

Issue 2807463004: GN: aix port along with linux_s390x, linux_ppc64 and linux_ppc64le support. (Closed)
Patch Set: removed the changes from //base/BUILD.gn Created 3 years, 8 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/process/process_posix.cc ('k') | base/strings/string16.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/rand_util_posix.cc
diff --git a/base/rand_util_posix.cc b/base/rand_util_posix.cc
index 469f7af9bf36ae2df93cdea214edbb661c27e574..aaad67f177f397cffda845795fbaa625cd9fc4f7 100644
--- a/base/rand_util_posix.cc
+++ b/base/rand_util_posix.cc
@@ -23,9 +23,17 @@ namespace {
// we can use LazyInstance to handle opening it on the first access.
class URandomFd {
public:
+#if defined(OS_AIX)
+ // AIX has no 64-bit support for open falgs such as -
+ // O_CLOEXEC, O_NOFOLLOW and O_TTY_INIT
+ URandomFd() : fd_(HANDLE_EINTR(open("/dev/urandom", O_RDONLY))) {
+ DCHECK_GE(fd_, 0) << "Cannot open /dev/urandom: " << errno;
+ }
+#else
URandomFd() : fd_(HANDLE_EINTR(open("/dev/urandom", O_RDONLY | O_CLOEXEC))) {
DCHECK_GE(fd_, 0) << "Cannot open /dev/urandom: " << errno;
}
+#endif
~URandomFd() { close(fd_); }
« no previous file with comments | « base/process/process_posix.cc ('k') | base/strings/string16.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698