]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - tools/mkimage.c
* Patch by Bernhard Kuhn, 28 Oct 2003:
[karo-tx-uboot.git] / tools / mkimage.c
index 148ee8dc8377af06870cee37344aa3372b5d592b..0e83546550e1c9d5757bfb1080234e5f66567464 100644 (file)
@@ -268,7 +268,7 @@ NXTARG:             ;
        imagefile = *argv;
 
        if (lflag) {
-               ifd = open(imagefile, O_RDONLY);
+               ifd = open(imagefile, O_RDONLY|O_BINARY);
        } else {
                ifd = open(imagefile, O_RDWR|O_CREAT|O_TRUNC|O_BINARY, 0666);
        }
@@ -502,7 +502,7 @@ copy_file (int ifd, const char *datafile, int pad)
                fprintf (stderr, "Adding Image %s\n", datafile);
        }
 
-       if ((dfd = open(datafile, O_RDONLY)) < 0) {
+       if ((dfd = open(datafile, O_RDONLY|O_BINARY)) < 0) {
                fprintf (stderr, "%s: Can't open %s: %s\n",
                        cmdname, datafile, strerror(errno));
                exit (EXIT_FAILURE);