[flashrom] [PATCH] Kill exit() calls in cli_classic

Uwe Hermann uwe at hermann-uwe.de
Sat Sep 3 19:18:55 CEST 2011


On Sun, Aug 21, 2011 at 11:10:48PM +0300, Tadas Slotkus wrote:
> exit() calls are very bad. GUI's and payload don't like it,
> so remove it for easier flashrom usage across projects.

Not sure about this patch. Removing exit() calls from libflashrom code
is definately required, but cli_classic.c is the CLI tool (not part of
libflashrom) and can have exit()s, no big problems here.

Shouldn't affect flashrom usage as payload either, unless I'm missing
something?


> @@ -164,7 +163,7 @@ int main(int argc, char *argv[])
>  			if (++operation_specified > 1) {
>  				fprintf(stderr, "More than one operation "
>  					"specified. Aborting.\n");
> -				cli_classic_abort_usage();
> +				cli_classic_abort_usage(); return 1;

The "return 1" would have to be on an extra line btw.


Uwe.
-- 
http://hermann-uwe.de     | http://sigrok.org
http://randomprojects.org | http://unmaintained-free-software.org




More information about the flashrom mailing list