]> www.infradead.org Git - mtd-utils.git/commit
ubiformat/ubinize: Don't randomize 0xFFFFFFFF sequence number
authorMichael Roth <mroth@nessie.de>
Wed, 23 Sep 2009 13:01:27 +0000 (15:01 +0200)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Mon, 28 Sep 2009 08:19:14 +0000 (11:19 +0300)
commit0e63a4c4f1ebc31f545835bd018174414928fc6f
tree461b4ed87909134afa3e2579b07d7fbc4412e053
parent145ee7ab6fc9c4ccb6f3497d5fb112ed6f696433
ubiformat/ubinize: Don't randomize 0xFFFFFFFF sequence number

args.image_seq is of type uint32_t and was initialized to -1 which
becomes 0xFFFFFFFF in this case. Later the value -1 was used as a flag
that args.image_seq should be replaced with a randomized value.

With the option --image-seq (-Q) a user could provide any sequence
number at will.

But when the user provided sequence number was 0xFFFFFFFF this was
understood effectivly as -1 and got overridden by a randomized
sequence number.

So this patch change the programm flow to respect the principle of
least surprise and never use a randomized sequence number when the
user provide one at own will.

Signed-off-by: Michael Roth <mroth@nessie.de>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
ubi-utils/src/ubiformat.c
ubi-utils/src/ubinize.c