libclamav/others.c: call srand() already in cli_init() (bb#1728)

0.96
Tomasz Kojm 16 years ago
parent d90f43a176
commit 53e8cd6f12
  1. 4
      ChangeLog
  2. 5
      libclamav/others.c

@ -1,3 +1,7 @@
Mon Oct 26 16:09:29 CET 2009 (tk)
---------------------------------
* libclamav/others.c: call srand() already in cli_init() (bb#1728)
Mon Oct 26 13:08:41 CET 2009 (tk)
---------------------------------
* clamdscan/proto.c: handle recv() == 0 (bb#1717)

@ -255,10 +255,15 @@ const char *cl_strerror(int clerror)
int cl_init(unsigned int initoptions)
{
struct timeval tv;
unsigned int pid = (unsigned int) getpid();
/* put dlopen() stuff here, etc. */
if (lt_init() == 0) {
cli_rarload();
}
gettimeofday(&tv, (struct timezone *) 0);
srand(pid + tv.tv_usec*++pid + clock());
return CL_SUCCESS;
}

Loading…
Cancel
Save