mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
linux compile
This commit is contained in:
parent
779f12d653
commit
715b80c430
@ -33,8 +33,8 @@ namespace mongo {
|
||||
_initialized = true;
|
||||
|
||||
#if defined(__linux__)
|
||||
devrandom = new ifstream("/dev/urandom", ios::binary|ios::in);
|
||||
massert( "can't open dev/urandom", devrandom->is_open() );
|
||||
_devrandom = new ifstream("/dev/urandom", ios::binary|ios::in);
|
||||
massert( "can't open dev/urandom", _devrandom->is_open() );
|
||||
#elif defined(_WIN32)
|
||||
srand(curTimeMicros());
|
||||
#else
|
||||
@ -56,8 +56,8 @@ namespace mongo {
|
||||
|
||||
nonce n;
|
||||
#if defined(__linux__)
|
||||
devrandom->read((char*)&n, sizeof(n));
|
||||
massert("devrandom failed", !devrandom->fail());
|
||||
_devrandom->read((char*)&n, sizeof(n));
|
||||
massert("devrandom failed", !_devrandom->fail());
|
||||
#elif defined(_WIN32)
|
||||
n = (((unsigned long long)rand())<<32) | rand();
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user