mkimage: do not fail if there is no print_header function
authorGuillaume GARDET <guillaume.gardet@free.fr>
Fri, 30 Mar 2018 08:28:19 +0000 (10:28 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 10 Apr 2018 15:52:16 +0000 (11:52 -0400)
Commit 253c60a breaks the exit value of 'mkimage -T rkimage'
and print the following  error:
  mkimage: Can't print header for Rockchip Boot Image support: Success

It is not a failure to not print headers, so just display the warning message,
and finish the function properly.

Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr>
Cc: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Tom Rini <trini@konsulko.com>
Reviewed-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
tools/mkimage.c

index 28ff35e670a3e37ccce21cbe16f30a2959aa35d6..4e561820e7723597a46d3804cad3a236522e9e69 100644 (file)
@@ -588,9 +588,8 @@ int main(int argc, char **argv)
        if (tparams->print_header)
                tparams->print_header (ptr);
        else {
-               fprintf (stderr, "%s: Can't print header for %s: %s\n",
-                       params.cmdname, tparams->name, strerror(errno));
-               exit (EXIT_FAILURE);
+               fprintf (stderr, "%s: Can't print header for %s\n",
+                       params.cmdname, tparams->name);
        }
 
        (void) munmap((void *)ptr, sbuf.st_size);