summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Doyle <wpdster@gmail.com>2019-07-01 14:25:28 -0400
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-02 14:33:07 +0200
commitce51dfe8c4e8ca25f23f3b48c8662bfd1fda1f37 (patch)
tree709b00fcb2a2618c746b15b4a6e29ea9c341fbd3
parentbdcda755f2518dfbdc63a53fd4c820afe3f81859 (diff)
ubinize: Exit with non-zero exit code on error.
...specifically -1 in all of the new cases. Signed-off-by: Patrick Doyle <pdoyle@irobot.com> Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
-rw-r--r--ubi-utils/ubinize.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/ubi-utils/ubinize.c b/ubi-utils/ubinize.c
index b603638..967b65c 100644
--- a/ubi-utils/ubinize.c
+++ b/ubi-utils/ubinize.c
@@ -442,11 +442,14 @@ int main(int argc, char * const argv[])
verbose(args.verbose, "UBI image sequence number: %u", ui.image_seq);
vtbl = ubigen_create_empty_vtbl(&ui);
- if (!vtbl)
+ if (!vtbl) {
+ err = -1;
goto out;
+ }
args.dict = iniparser_load(args.f_in);
if (!args.dict) {
+ err = -1;
errmsg("cannot load the input ini file \"%s\"", args.f_in);
goto out_vtbl;
}
@@ -456,17 +459,20 @@ int main(int argc, char * const argv[])
/* Each section describes one volume */
sects = iniparser_getnsec(args.dict);
if (sects == -1) {
+ err = -1;
errmsg("ini-file parsing error (iniparser_getnsec)");
goto out_dict;
}
verbose(args.verbose, "count of sections: %d", sects);
if (sects == 0) {
+ err = -1;
errmsg("no sections found the ini-file \"%s\"", args.f_in);
goto out_dict;
}
if (sects > ui.max_volumes) {
+ err = -1;
errmsg("too many sections (%d) in the ini-file \"%s\"",
sects, args.f_in);
normsg("each section corresponds to an UBI volume, maximum "
@@ -476,6 +482,7 @@ int main(int argc, char * const argv[])
vi = calloc(sizeof(struct ubigen_vol_info), sects);
if (!vi) {
+ err = -1;
errmsg("cannot allocate memory");
goto out_dict;
}