]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - tools/ubsha1.c
Merge branch 'master' of git://git.denx.de/u-boot-i2c
[people/ms/u-boot.git] / tools / ubsha1.c
index bc877606d2ffc36ff021d6c81653bc2c6b9da6a7..c4203ed99e3da8e55fcb93c4a1edd09d132530e6 100644 (file)
  * MA 02111-1307 USA
  */
 
+#include "os_support.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <fcntl.h>
 #include <errno.h>
 #include <string.h>
+#ifndef __MINGW32__
 #include <sys/mman.h>
+#endif
 #include <sys/stat.h>
 #include "sha1.h"
 
@@ -84,7 +87,7 @@ int main (int argc, char **argv)
                                cmdname, imagefile, strerror(errno));
                        exit (EXIT_FAILURE);
                }
-       
+
                /* create a copy, so we can blank out the sha1 sum */
                data = malloc (len);
                memcpy (data, ptr, len);
@@ -93,12 +96,11 @@ int main (int argc, char **argv)
                for (i = 0; i < SHA1_SUM_LEN; i++) {
                        ptroff[i] = 0;
                }
-       
+
                sha1_csum ((unsigned char *) data, len, (unsigned char *)output);
 
                printf ("U-Boot sum:\n");
-               for (i = 0; i < 20 ; i++)
-               {
+               for (i = 0; i < 20 ; i++) {
                    printf ("%02X ", output[i]);
                }
                printf ("\n");
@@ -109,7 +111,7 @@ int main (int argc, char **argv)
                                cmdname, imagefile, strerror(errno));
                        exit (EXIT_FAILURE);
                }
-       
+
                free (data);
                (void) munmap((void *)ptr, len);
                (void) close (ifd);