]> git.lizzy.rs Git - plan9front.git/commitdiff
ip/torrent: avoid peerid collision using truerand() instead of time(0)
authorcinap_lenrek <cinap_lenrek@felloff.net>
Mon, 20 Mar 2017 18:11:03 +0000 (19:11 +0100)
committercinap_lenrek <cinap_lenrek@felloff.net>
Mon, 20 Mar 2017 18:11:03 +0000 (19:11 +0100)
sys/src/cmd/ip/torrent.c

index 7b89a40b794b1c5f32bf7961bddb6e6e0a45ddf6..fc324977bcfca04ce8a51184529c49f02f47a1cf 100644 (file)
@@ -1352,7 +1352,7 @@ main(int argc, char *argv[])
        while(waitpid() >= 0)
                ;
 
-       srand(time(0));
+       srand(truerand());
        atnotify(catch, 1);
        switch(i = rfork(RFPROC|RFMEM|RFNOTEG)){
        case -1: