Skip to content

Commit

Permalink
Messenger: Fix rand() generate the same sequence numbers
Browse files Browse the repository at this point in the history
Signed-off-by: Haomai Wang <[email protected]>
  • Loading branch information
yuyuyu101 committed Aug 26, 2015
1 parent 23ebeb3 commit 55cec07
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/msg/Messenger.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Messenger *Messenger::create(CephContext *cct, const string &type,
uint64_t nonce, uint64_t features)
{
int r = -1;
srand(time(NULL));
if (type == "random")
r = rand() % 2; // random does not include xio
if (r == 0 || type == "simple")
Expand Down

0 comments on commit 55cec07

Please sign in to comment.