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/ubinize.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'ubi-utils/src/ubinize.c') diff --git a/ubi-utils/src/ubinize.c b/ubi-utils/src/ubinize.c index 74ddc0f..ab5b0b8 100644 --- a/ubi-utils/src/ubinize.c +++ b/ubi-utils/src/ubinize.c @@ -24,13 +24,10 @@ * Oliver Lohmann */ -#include -#include #include #include #include #include -#include #include #include @@ -157,8 +154,8 @@ static struct args args = { 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