From patchwork Thu Jul 19 02:59:45 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Frysinger X-Patchwork-Id: 171862 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 723682C009B for ; Thu, 19 Jul 2012 12:59:36 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 65A312808A; Thu, 19 Jul 2012 04:59:33 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RNgr28HIO6U4; Thu, 19 Jul 2012 04:59:32 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 9036628095; Thu, 19 Jul 2012 04:59:30 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BEA4828095 for ; Thu, 19 Jul 2012 04:59:28 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r6cLqMW+cm+a for ; Thu, 19 Jul 2012 04:59:28 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by theia.denx.de (Postfix) with ESMTPS id EAC462808A for ; Thu, 19 Jul 2012 04:59:27 +0200 (CEST) Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id 72AF31B4003; Thu, 19 Jul 2012 02:59:22 +0000 (UTC) From: Mike Frysinger To: u-boot@lists.denx.de Date: Wed, 18 Jul 2012 22:59:45 -0400 Message-Id: <1342666785-23439-1-git-send-email-vapier@gentoo.org> X-Mailer: git-send-email 1.7.9.7 Subject: [U-Boot] [PATCH] tools: clean up mingw ifdefs X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 --- tools/mingw_support.h | 8 ++++++++ tools/mkenvimage.c | 10 ++-------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/tools/mingw_support.h b/tools/mingw_support.h index ee07290..48b8010 100644 --- a/tools/mingw_support.h +++ b/tools/mingw_support.h @@ -34,6 +34,14 @@ #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)) diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c index 4001d2f..5521268 100644 --- a/tools/mkenvimage.c +++ b/tools/mkenvimage.c @@ -46,13 +46,6 @@ #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 ] -s -o \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));