diff options
author | Ludovic Courtès <ludo@gnu.org> | 2018-02-08 14:05:17 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-02-08 14:19:19 +0100 |
commit | 54256392719b291548aa936e9e185797f2523f04 (patch) | |
tree | 5da975c01fee76d5586ac3f4d3209931638eccff | |
parent | 57410b6cc27b4474360b0a397604a4eb8d29f28a (diff) | |
download | cuirass-54256392719b291548aa936e9e185797f2523f04.tar cuirass-54256392719b291548aa936e9e185797f2523f04.tar.gz |
examples: random: Make derivations a bit more random.
* examples/random-jobs.scm (random-derivation): Tweak the computation of
SEED. Actually use the new random state.
-rw-r--r-- | examples/random-jobs.scm | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/examples/random-jobs.scm b/examples/random-jobs.scm index 9918cd1..9d26892 100644 --- a/examples/random-jobs.scm +++ b/examples/random-jobs.scm @@ -33,10 +33,11 @@ (let ((nonce (random 1e6))) (run-with-store store (gexp->derivation "random" - #~(let ((seed (logxor (getpid) - (car (gettimeofday))))) - (seed->random-state seed) - (sleep (pk 'sleeping (random 10))) + #~(let* ((seed (logxor #$(cdr (gettimeofday)) + (car (gettimeofday)) + (cdr (gettimeofday)))) + (state (seed->random-state seed))) + (sleep (pk 'sleeping (random 10 state))) #$nonce (mkdir #$output)))))) |