[U-Boot] [PATCH v2 4/9] Stop using builtin_run_command()

Wolfgang Denk wd at denx.de
Fri Jan 13 20:27:16 CET 2012


Dear Simon Glass,

In message <1323542641-14541-5-git-send-email-sjg at chromium.org> you wrote:
> This function is only one of the parser options, so use run_command()
> instead. It knows how to use hush if selected.
...

>  	debug("Starting %s process...\n", __FUNCTION__);
> -#if !defined(CONFIG_SYS_HUSH_PARSER)
> -	ret = builtin_run_command(s, 0);
> -#else
> -	ret = parse_string_outer(s, FLAG_PARSE_SEMICOLON
> -				  | FLAG_EXIT_FROM_LOOP);
> -#endif
> +	ret = run_command(s, 0);
>  	if (ret < 0)
>  		debug("Error.. %s failed\n", __FUNCTION__);
...

> -#ifndef CONFIG_SYS_HUSH_PARSER
> -	if (builtin_run_command(getenv("bootcmd"), flag) < 0)
> +	if (run_command(getenv("bootcmd"), flag) < 0)
>  		rcode = 1;
> -#else
> -	if (parse_string_outer(getenv("bootcmd"),
> -			FLAG_PARSE_SEMICOLON | FLAG_EXIT_FROM_LOOP) != 0)
> -		rcode = 1;
> -#endif

I think this breaks error handling in a large scale.

run_command2() in "common/main.c" (now renamed into run_command() will
return 0 or 1 when used with the hush shell; it will never return < 0.

Please fix globally.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Parkinson's Law:  Work expands to fill the time alloted it.


More information about the U-Boot mailing list