]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
tools: clean up mingw ifdefs
authorMike Frysinger <vapier@gentoo.org>
Wed, 18 Jul 2012 16:59:45 +0000 (16:59 +0000)
committerWolfgang Denk <wd@denx.de>
Fri, 20 Jul 2012 06:53:34 +0000 (08:53 +0200)
We have a header file specifically for mingw cruft, so keep it there
to avoid crap spreading into the main tools.  This lets our devs just
worry about *nix systems.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
tools/mingw_support.h
tools/mkenvimage.c

index ee07290b5a2961a76378a06ec5a07b84c566c003..48b8010f0b6beb0faffc5a5451d0ee3e565170d6 100644 (file)
 #define MAP_SHARED     0x01            /* Share changes */
 #define MAP_PRIVATE    0x02            /* Changes are private */
 
+/* File perms */
+#ifndef S_IRGRP
+# define S_IRGRP 0
+#endif
+#ifndef S_IWGRP
+# define S_IWGRP 0
+#endif
+
 /* Windows 64-bit access macros */
 #define LODWORD(x) ((DWORD)((DWORDLONG)(x)))
 #define HIDWORD(x) ((DWORD)(((DWORDLONG)(x) >> 32) & 0xffffffff))
index 4001d2f517d78040653a2c51c5194e70552fc123..55212687e17d0162790002c1c3e5fffbfccb45ca 100644 (file)
 
 #define CRC_SIZE sizeof(uint32_t)
 
-#ifdef __MINGW32__
-#define FILE_PERM              (S_IRUSR | S_IWUSR)
-#else
-#define FILE_PERM              (S_IRUSR | S_IWUSR | S_IRGRP |\
-                                            S_IWGRP)
-#endif
-
 static void usage(const char *exec_name)
 {
        fprintf(stderr, "%s [-h] [-r] [-b] [-p <byte>] -s <environment partition size> -o <output> <input file>\n"
@@ -300,7 +293,8 @@ int main(int argc, char **argv)
        if (!bin_filename || strcmp(bin_filename, "-") == 0) {
                bin_fd = STDOUT_FILENO;
        } else {
-               bin_fd = creat(bin_filename, FILE_PERM);
+               bin_fd = creat(bin_filename, S_IRUSR | S_IWUSR | S_IRGRP |
+                                            S_IWGRP);
                if (bin_fd == -1) {
                        fprintf(stderr, "Can't open output file \"%s\": %s\n",
                                        bin_filename, strerror(errno));