]> Git Repo - J-u-boot.git/blobdiff - tools/mkimage.c
tools: kwbimage: Set BOOT_FROM by default to SPI
[J-u-boot.git] / tools / mkimage.c
index 302bfcf971fd83c43f7a28fd07945d9be428dd78..fbe883ce3620e1d31a1d8435498542ac543f0971 100644 (file)
@@ -732,6 +732,12 @@ copy_file (int ifd, const char *datafile, int pad)
                exit (EXIT_FAILURE);
        }
 
+       if (sbuf.st_size == 0) {
+               fprintf (stderr, "%s: Input file %s is empty, bailing out\n",
+                       params.cmdname, datafile);
+               exit (EXIT_FAILURE);
+       }
+
        ptr = mmap(0, sbuf.st_size, PROT_READ, MAP_SHARED, dfd, 0);
        if (ptr == MAP_FAILED) {
                fprintf (stderr, "%s: Can't read %s: %s\n",
This page took 0.024423 seconds and 4 git commands to generate.