From 75d97ca45b74eccc01b18f44040f946d9d5df9f5 Mon Sep 17 00:00:00 2001 From: Artem Bityutskiy Date: Mon, 28 Sep 2009 11:50:51 +0300 Subject: ubinize/ubiformat: improve random number seeding Add current time to the PID to improve the pseudo-random number generator seeding. Also, use 'rand()' instead of 'random()', because 'srand()' is for 'rand()'. Signed-off-by: Artem Bityutskiy --- ubi-utils/src/ubiformat.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ubi-utils/src/ubiformat.c') diff --git a/ubi-utils/src/ubiformat.c b/ubi-utils/src/ubiformat.c index 54363d7..62375a6 100644 --- a/ubi-utils/src/ubiformat.c +++ b/ubi-utils/src/ubiformat.c @@ -29,7 +29,6 @@ */ #define MAX_CONSECUTIVE_BAD_BLOCKS 4 -#include #include #include #include @@ -130,8 +129,8 @@ static const struct option long_options[] = { static int parse_opt(int argc, char * const argv[]) { - srand(getpid()); - args.image_seq = random(); + ubiutils_srand(); + args.image_seq = rand(); while (1) { int key; -- cgit v1.2.3