提交 773a4c1f authored 作者: Anthony Minessale's avatar Anthony Minessale

FS-4128

上级 7427fb96
...@@ -94,14 +94,10 @@ struct local_stream_source { ...@@ -94,14 +94,10 @@ struct local_stream_source {
typedef struct local_stream_source local_stream_source_t; typedef struct local_stream_source local_stream_source_t;
static unsigned int S = 0;
static int do_rand(void) static int do_rand(void)
{ {
double r; double r;
int index; int index;
unsigned int seed = ++S + getpid();
srand(seed);
r = ((double) rand() / ((double) (RAND_MAX) + (double) (1))); r = ((double) rand() / ((double) (RAND_MAX) + (double) (1)));
index = (int) (r * 9) + 1; index = (int) (r * 9) + 1;
return index; return index;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论