mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-21 22:53:37 +00:00
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:
@@ -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")) {
|
||||
|
||||
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user