[PATCH] fio: update default random seed
authorJens Axboe <axboe@suse.de>
Thu, 27 Oct 2005 07:29:37 +0000 (09:29 +0200)
committerJens Axboe <axboe@suse.de>
Thu, 27 Oct 2005 07:29:37 +0000 (09:29 +0200)
fio.c

diff --git a/fio.c b/fio.c
index 8e33014f26c43201ca3a8bfdcb8e0ea066b20396..0bc22e897d2f6b9d348129b32afb5827d4e4664e 100644 (file)
--- a/fio.c
+++ b/fio.c
@@ -126,6 +126,7 @@ enum {
 #define DEF_CREATE     (1)
 #define DEF_INVALIDATE (1)
 #define DEF_SYNCIO     (0)
+#define DEF_RANDSEED   (0xb1899bedUL)
 
 #define ALIGN(buf)     (char *) (((unsigned long) (buf) + MASK) & ~(MASK))
 
@@ -294,7 +295,7 @@ static void sig_handler(int sig)
 
 static int init_random_state(struct thread_data *td)
 {
-       unsigned long seed = 123;
+       unsigned long seed;
 
        if (td->sequential)
                return 0;
@@ -314,7 +315,8 @@ static int init_random_state(struct thread_data *td)
                }
 
                close(fd);
-       }
+       } else
+               seed = DEF_RANDSEED;
 
        srand48_r(seed, &td->random_state);
        return 0;