From: Wolfgang Denk Date: Wed, 24 Oct 2018 15:58:40 +0200 Subject: [U-Boot] [PATCH] tools: imx8image: return SUCCESS when the required files not found In-Reply-To: <20181024051500.12467-1-peng.fan@nxp.com> References: <20181024051500.12467-1-peng.fan@nxp.com> Message-ID: <20181024135840.1F63124004C@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Peng Fan, In message <20181024051500.12467-1-peng.fan@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 > 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