X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=tools%2Fmkenvimage.c;h=bbd3041e36f4e5a2ac909fbe101ecfdd91b6345b;hb=ce3ca05d77a0b7e80afa111080b16d9d61a88a59;hp=4001d2f517d78040653a2c51c5194e70552fc123;hpb=8b6a4952e6064dc558cb7d5d375990b17491f26f;p=u-boot diff --git a/tools/mkenvimage.c b/tools/mkenvimage.c index 4001d2f517..bbd3041e36 100644 --- a/tools/mkenvimage.c +++ b/tools/mkenvimage.c @@ -6,28 +6,9 @@ * (C) Copyright 2001 * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it * - * See file CREDITS for list of people who contributed to this - * project. - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, - * MA 02111-1307 USA + * SPDX-License-Identifier: GPL-2.0+ */ -/* We want the GNU version of basename() */ -#define _GNU_SOURCE - #include #include #include @@ -46,13 +27,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 +274,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));