tests/mount-local, tests/parallel: Use srandom (time (NULL) + getpid ()).

If two instances of the test start at exactly the same time, they
would have the same random number seed.
This commit is contained in:
Richard W.M. Jones
2017-01-26 15:49:35 +00:00
parent 5d607f752b
commit 535e6f5ebb
2 changed files with 3 additions and 2 deletions

View File

@@ -85,7 +85,7 @@ main (int argc, char *argv[])
int r, errors = 0;
void *status;
srandom (time (NULL));
srandom (time (NULL) + getpid ());
/* If the --test flag is given, then this is the test subprocess. */
if (argc == 3 && STREQ (argv[1], "--test")) {

View File

@@ -31,6 +31,7 @@
#include <signal.h>
#include <errno.h>
#include <error.h>
#include <sys/types.h>
#include <pthread.h>
@@ -74,7 +75,7 @@ main (int argc, char *argv[])
size_t i, errors = 0;
void *status;
srandom (time (NULL));
srandom (time (NULL) + getpid ());
/* Only run this test when invoked by check-slow. */
slow = getenv ("SLOW");