From: Vladimir Serbinenko Date: Mon, 27 Jul 2015 10:42:47 +0000 (+0200) Subject: grub-install: Use a+ in fopen rather than r+. X-Git-Tag: 2.02-beta3~234 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2721778e5234fc87af7c3bf2b7cfdaca3abfa60;p=thirdparty%2Fgrub.git grub-install: Use a+ in fopen rather than r+. r+ does not create a file if none exists. --- diff --git a/util/grub-install.c b/util/grub-install.c index 566272600..df5c7e520 100644 --- a/util/grub-install.c +++ b/util/grub-install.c @@ -1727,7 +1727,7 @@ main (int argc, char *argv[]) grub_elf = grub_util_path_concat (2, core_services, "grub.elf"); grub_install_copy_file (imgfile, grub_elf, 1); - f = grub_util_fopen (mach_kernel, "r+"); + f = grub_util_fopen (mach_kernel, "a+"); if (!f) grub_util_error (_("Can't create file: %s"), strerror (errno)); fclose (f);