]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
grub-install: Use a+ in fopen rather than r+.
authorVladimir Serbinenko <phcoder@gmail.com>
Mon, 27 Jul 2015 10:42:47 +0000 (12:42 +0200)
committerVladimir Serbinenko <phcoder@gmail.com>
Mon, 27 Jul 2015 10:42:47 +0000 (12:42 +0200)
r+ does not create a file if none exists.

util/grub-install.c

index 566272600266b91076aaa3ada62046d7d5981931..df5c7e5202f0c79130f966bb2757ec42979d8f9b 100644 (file)
@@ -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);