diff options
author | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-09 02:22:27 +0000 |
---|---|---|
committer | danieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7> | 2010-02-09 02:22:27 +0000 |
commit | aab7998583ca16590a32c7bdb80955a18b090700 (patch) | |
tree | a2b7f6d82a523e683347b7489ab77f0e940bdede /src/inspircd.cpp | |
parent | db790d9d1516c9c7cd48738340e5df1c8a2bebe3 (diff) |
Add random number generation functions to InspIRCd class.
Default implementation uses libc random(), which can be better than rand().
If gnutls is loaded, gcrypt will be used to provide random numbers.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@12404 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/inspircd.cpp')
-rw-r--r-- | src/inspircd.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/inspircd.cpp b/src/inspircd.cpp index fe0ac0a11..b95a6fecb 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -295,6 +295,7 @@ InspIRCd::InspIRCd(int argc, char** argv) : */ NICKForced("NICKForced", NULL), OperQuit("OperQuit", NULL), + GenRandom(&HandleGenRandom), IsChannel(&HandleIsChannel), IsSID(&HandleIsSID), Rehash(&HandleRehash), @@ -375,7 +376,7 @@ InspIRCd::InspIRCd(int argc, char** argv) : this->Config->cmdline.argv = argv; this->Config->cmdline.argc = argc; - srand(TIME.tv_nsec ^ TIME.tv_sec); + srandom(TIME.tv_nsec ^ TIME.tv_sec); struct option longopts[] = { |