1 From 5f50207231414bfdbac8f0f974a2824f24177d6e Mon Sep 17 00:00:00 2001
2 From: Enrico Jorns <ejo@pengutronix.de>
3 Date: Fri, 11 Sep 2015 15:28:13 +0200
4 Subject: [PATCH] mtd-utils: ubinize: Always return error code (at least -1) in
7 ubinize should not fail silenty, this can be very annoying when using
8 it from other tools that rely on the exit code for determining the
9 success of their operation.
11 Signed-off-by: Enrico Jorns <ejo@pengutronix.de>
12 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
13 Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
15 ubi-utils/ubinize.c | 5 +++++
16 1 file changed, 5 insertions(+)
18 diff --git a/ubi-utils/ubinize.c b/ubi-utils/ubinize.c
19 index 34f465a..60bbd9a 100644
20 --- a/ubi-utils/ubinize.c
21 +++ b/ubi-utils/ubinize.c
22 @@ -519,6 +519,7 @@ int main(int argc, char * const argv[])
24 seek = ui.peb_size * 2;
25 if (lseek(args.out_fd, seek, SEEK_SET) != seek) {
27 sys_errmsg("cannot seek file \"%s\"", args.f_out);
30 @@ -530,6 +531,7 @@ int main(int argc, char * const argv[])
35 errmsg("ini-file parsing error (iniparser_getsecname)");
38 @@ -550,6 +552,7 @@ int main(int argc, char * const argv[])
40 for (j = 0; j < i; j++) {
41 if (vi[i].id == vi[j].id) {
43 errmsg("volume IDs must be unique, but ID %d "
44 "in section \"%s\" is not",
46 @@ -557,6 +560,7 @@ int main(int argc, char * const argv[])
49 if (!strcmp(vi[i].name, vi[j].name)) {
51 errmsg("volume name must be unique, but name "
52 "\"%s\" in section \"%s\" is not",
54 @@ -580,6 +584,7 @@ int main(int argc, char * const argv[])
56 fd = open(img, O_RDONLY);
59 sys_errmsg("cannot open \"%s\"", img);