Use grub_util_fd_{open,close} rather than {fopen,fclose}.

This commit is contained in:
Colin Watson 2013-11-15 17:08:58 +00:00
parent 12c2d335d1
commit ccfba44655
2 changed files with 7 additions and 5 deletions

View File

@ -20,12 +20,13 @@ Index: b/util/setup.c
goto finish; goto finish;
} }
@@ -619,6 +623,9 @@ @@ -619,6 +623,10 @@
/* The core image must be put on a filesystem unfortunately. */ /* The core image must be put on a filesystem unfortunately. */
grub_util_info ("will leave the core image on the filesystem"); grub_util_info ("will leave the core image on the filesystem");
+ fp = fopen (DEFAULT_DIRECTORY "/" CORE_IMG_IN_FS, "w"); + fp = grub_util_fd_open (DEFAULT_DIRECTORY "/" CORE_IMG_IN_FS,
+ fclose (fp); + GRUB_UTIL_FD_O_WRONLY);
+ grub_util_fd_close (fp);
+ +
grub_util_biosdisk_flush (root_dev->disk); grub_util_biosdisk_flush (root_dev->disk);

View File

@ -623,8 +623,9 @@ unable_to_embed:
/* The core image must be put on a filesystem unfortunately. */ /* The core image must be put on a filesystem unfortunately. */
grub_util_info ("will leave the core image on the filesystem"); grub_util_info ("will leave the core image on the filesystem");
fp = fopen (DEFAULT_DIRECTORY "/" CORE_IMG_IN_FS, "w"); fp = grub_util_fd_open (DEFAULT_DIRECTORY "/" CORE_IMG_IN_FS,
fclose (fp); GRUB_UTIL_FD_O_WRONLY);
grub_util_fd_close (fp);
grub_util_biosdisk_flush (root_dev->disk); grub_util_biosdisk_flush (root_dev->disk);