Merge pull request #5671 from ceph/wip-msgr-fix-random

Messenger: Fix rand() generate the same sequence numbers

Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Sage Weil 2015-08-26 10:52:29 -04:00
commit dda1016d5d

View File

@ -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")