From aab7998583ca16590a32c7bdb80955a18b090700 Mon Sep 17 00:00:00 2001 From: danieldg Date: Tue, 9 Feb 2010 02:22:27 +0000 Subject: 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 --- src/inspircd.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/inspircd.cpp') 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[] = { -- cgit v1.2.3