summaryrefslogtreecommitdiff
path: root/ubi-utils/src/ubinize.c
diff options
context:
space:
mode:
Diffstat (limited to 'ubi-utils/src/ubinize.c')
-rw-r--r--ubi-utils/src/ubinize.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/ubi-utils/src/ubinize.c b/ubi-utils/src/ubinize.c
index a46833c..74ddc0f 100644
--- a/ubi-utils/src/ubinize.c
+++ b/ubi-utils/src/ubinize.c
@@ -153,11 +153,13 @@ static struct args args = {
.min_io_size = -1,
.subpage_size = -1,
.ubi_ver = 1,
- .image_seq = -1,
};
static int parse_opt(int argc, char * const argv[])
{
+ srand(getpid());
+ args.image_seq = random();
+
while (1) {
int key;
char *endp;
@@ -283,10 +285,6 @@ static int parse_opt(int argc, char * const argv[])
return errmsg("VID header offset has to be multiple of min. I/O unit size");
}
- if (!args.image_seq == -1) {
- srand(getpid());
- args.image_seq = random();
- }
return 0;
}