]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Messenger: Fix rand() generate the same sequence numbers 5671/head
authorHaomai Wang <haomaiwang@gmail.com>
Wed, 26 Aug 2015 04:21:15 +0000 (12:21 +0800)
committerHaomai Wang <haomaiwang@gmail.com>
Wed, 26 Aug 2015 04:21:15 +0000 (12:21 +0800)
Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
src/msg/Messenger.cc

index 43e66c985f7c071626d41120eaa186cf21fd2784..0d38c139fac3708ed18a0278215863515a3f7553 100644 (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")