* [PATCH] ubinize: Exit with non-zero exit code on error.
@ 2019-07-01 18:25 Patrick Doyle
2019-07-02 12:43 ` David Oberhollenzer
0 siblings, 1 reply; 3+ messages in thread
From: Patrick Doyle @ 2019-07-01 18:25 UTC (permalink / raw)
To: linux-mtd; +Cc: Patrick Doyle
...specifically -1 in all of the new cases.
Signed-off-by: Patrick Doyle <pdoyle@irobot.com>
---
ubi-utils/ubinize.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/ubi-utils/ubinize.c b/ubi-utils/ubinize.c
index c85ff9b..4e16871 100644
--- a/ubi-utils/ubinize.c
+++ b/ubi-utils/ubinize.c
@@ -430,11 +430,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;
}
@@ -444,17 +447,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 "
@@ -464,6 +470,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;
}
--
2.7.4
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ubinize: Exit with non-zero exit code on error.
2019-07-01 18:25 [PATCH] ubinize: Exit with non-zero exit code on error Patrick Doyle
@ 2019-07-02 12:43 ` David Oberhollenzer
2019-07-02 13:44 ` Patrick Doyle
0 siblings, 1 reply; 3+ messages in thread
From: David Oberhollenzer @ 2019-07-02 12:43 UTC (permalink / raw)
To: Patrick Doyle, linux-mtd; +Cc: Patrick Doyle
Applied to mtd-utils.git master.
Note: The source code uses tabs for indentation. I fixed that in the patch.
Thanks,
David
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ubinize: Exit with non-zero exit code on error.
2019-07-02 12:43 ` David Oberhollenzer
@ 2019-07-02 13:44 ` Patrick Doyle
0 siblings, 0 replies; 3+ messages in thread
From: Patrick Doyle @ 2019-07-02 13:44 UTC (permalink / raw)
To: David Oberhollenzer; +Cc: Patrick Doyle, linux-mtd
On Tue, Jul 2, 2019 at 8:43 AM David Oberhollenzer
<david.oberhollenzer@sigma-star.at> wrote:
> Note: The source code uses tabs for indentation. I fixed that in the patch.
Oh! Darn darn darn darn darn!!!!
I noticed that, and I meant to fix it. I'm sorry. Thanks for fixing it for me.
--wpd
______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-07-02 13:45 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-07-01 18:25 [PATCH] ubinize: Exit with non-zero exit code on error Patrick Doyle
2019-07-02 12:43 ` David Oberhollenzer
2019-07-02 13:44 ` Patrick Doyle
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.