[U-Boot] [PATCH] tools: imx8image: return SUCCESS when the required files not found

Wolfgang Denk wd at denx.de
Wed Oct 24 13:58:40 UTC 2018


Dear Peng Fan,

In message <20181024051500.12467-1-peng.fan at nxp.com> you wrote:
> When the required files to build a bootable imx8 image are not
> found, return EXIT_SUCCESS to avoid build CI system.
> And if the files are missing, give a error message during the build.

Full NAK.

Naked-by: Wolfgang Denk <wd at denx.de>

>  	if (tmp_fd < 0) {
> -		fprintf(stderr, "%s: Can't open: %s\n",
> +		fprintf(stderr, "*** %s: Can't open: %s ***\n",
>  			filename, strerror(errno));
> -		exit(EXIT_FAILURE);
> +		exit(EXIT_SUCCESS);

An error like this must ALWAYS be reported by a proper return / exit
code o fthe funtion / program, other wise it is impossible to use
such tools in any automatic scripts, pipelines etc.

Anything else is just fundamentally broken.  I am shocked to see
such a patch.


Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
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
It is common sense to take a method and try it. If it fails, admit it
frankly and try another. But above all, try something.
                                              - Franklin D. Roosevelt


More information about the U-Boot mailing list