Commit d8d384e1 authored by Yedidya Feldblum's avatar Yedidya Feldblum Committed by Facebook GitHub Bot

cut dep from Random onto File and FileUtil

Reviewed By: Gownta

Differential Revision: D31824054

fbshipit-source-id: 101f8daa3018e89c1857d4d2980e97bc8487ca21
parent 071b632b
......@@ -21,8 +21,6 @@
#include <random>
#include <folly/CppAttributes.h>
#include <folly/File.h>
#include <folly/FileUtil.h>
#include <folly/SingletonThreadLocal.h>
#include <folly/ThreadLocal.h>
#include <folly/detail/FileUtilDetail.h>
......@@ -35,6 +33,8 @@
#ifdef _MSC_VER
#include <wincrypt.h> // @manual
#else
#include <fcntl.h>
#endif
#if FOLLY_HAVE_GETRANDOM
......@@ -81,7 +81,7 @@ void readRandomDevice(void* data, size_t size) {
// Keep the random device open for the duration of the program.
static int randomFd = ::open("/dev/urandom", O_RDONLY | O_CLOEXEC);
PCHECK(randomFd >= 0);
bytesRead = readFull(randomFd, data, size);
bytesRead = fileutil_detail::wrapFull(::read, randomFd, data, size);
}
PCHECK(bytesRead >= 0);
CHECK_EQ(size_t(bytesRead), size);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment