From 2be50cacae3b600f699a07a3bc24505ad98b16a2 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Wed, 29 Dec 2010 06:33:30 +0000 Subject: [PATCH] * cygtls.cc: Include stdlib.h. (_cygtls::init_thread): Seed random number generator on a per-thread basis. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/cygtls.cc | 2 ++ 2 files changed, 8 insertions(+) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 51a7bb5fd..cd103f7e9 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2010-12-29 Christopher Faylor + + * cygtls.cc: Include stdlib.h. + (_cygtls::init_thread): Seed random number generator on a per-thread + basis. + 2010-12-27 Christopher Faylor * include/cygwin/version.h: Bump CYGWIN_VERSION_API_MINOR to 234. diff --git a/winsup/cygwin/cygtls.cc b/winsup/cygwin/cygtls.cc index c59f0cbd0..730c14182 100644 --- a/winsup/cygwin/cygtls.cc +++ b/winsup/cygwin/cygtls.cc @@ -10,6 +10,7 @@ details. */ #define USE_SYS_TYPES_FD_SET #include "cygtls.h" #include +#include #include "path.h" #include "fhandler.h" #include "dtable.h" @@ -93,6 +94,7 @@ _cygtls::init_thread (void *x, DWORD (*func) (void *, void *)) } local_clib._current_locale = "C"; locals.process_logmask = LOG_UPTO (LOG_DEBUG); + srand48 ((long int) &x); } thread_id = GetCurrentThreadId (); -- 2.43.5