diff --git a/debian/patches/core_in_fs.patch b/debian/patches/core_in_fs.patch index 691866511..ea6db6569 100644 --- a/debian/patches/core_in_fs.patch +++ b/debian/patches/core_in_fs.patch @@ -20,12 +20,13 @@ Index: b/util/setup.c goto finish; } -@@ -619,6 +623,9 @@ +@@ -619,6 +623,10 @@ /* The core image must be put on a filesystem unfortunately. */ grub_util_info ("will leave the core image on the filesystem"); -+ fp = fopen (DEFAULT_DIRECTORY "/" CORE_IMG_IN_FS, "w"); -+ fclose (fp); ++ fp = grub_util_fd_open (DEFAULT_DIRECTORY "/" CORE_IMG_IN_FS, ++ GRUB_UTIL_FD_O_WRONLY); ++ grub_util_fd_close (fp); + grub_util_biosdisk_flush (root_dev->disk); diff --git a/util/setup.c b/util/setup.c index 79a88f770..60d46e847 100644 --- a/util/setup.c +++ b/util/setup.c @@ -623,8 +623,9 @@ unable_to_embed: /* The core image must be put on a filesystem unfortunately. */ grub_util_info ("will leave the core image on the filesystem"); - fp = fopen (DEFAULT_DIRECTORY "/" CORE_IMG_IN_FS, "w"); - fclose (fp); + fp = grub_util_fd_open (DEFAULT_DIRECTORY "/" CORE_IMG_IN_FS, + GRUB_UTIL_FD_O_WRONLY); + grub_util_fd_close (fp); grub_util_biosdisk_flush (root_dev->disk);