diff options
Diffstat (limited to 'src/pattern_sim.c')
-rw-r--r-- | src/pattern_sim.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/pattern_sim.c b/src/pattern_sim.c index fd670c48..a3fea8e3 100644 --- a/src/pattern_sim.c +++ b/src/pattern_sim.c @@ -799,9 +799,12 @@ int main(int argc, char *argv[]) FILE *fh; unsigned long int seed; fh = fopen("/dev/urandom", "r"); - fread(&seed, sizeof(seed), 1, fh); + if ( fread(&seed, sizeof(seed), 1, fh) == 1 ) { + gsl_rng_set(rng, seed); + } else { + ERROR("Failed to seed random number generator\n"); + } fclose(fh); - gsl_rng_set(rng, seed); } powder.det = image.det; |