Don't override more informative errors.
* grub-core/commands/acpi.c (grub_cmd_acpi): Don't override errors. * grub-core/font/font.c (open_section): Likewise. * grub-core/loader/i386/bsd.c (grub_bsd_load_aout): New argument filename. Don't override errors. (grub_cmd_openbsd_ramdisk): Don't override errors. * grub-core/loader/i386/linux.c (grub_cmd_linux): Likewise. (grub_cmd_initrd): Likewise. * grub-core/loader/i386/pc/linux.c (grub_cmd_linux): Likewise. (grub_cmd_initrd): Likewise. * grub-core/loader/ia64/efi/linux.c (grub_load_elf64): Likewise. (grub_cmd_linux): Likewise. (grub_cmd_initrd): Likewise. (grub_cmd_payload): Likewise. * grub-core/loader/mips/linux.c (grub_cmd_initrd): Likewise. * grub-core/loader/multiboot.c (grub_cmd_multiboot): Likewise. (grub_cmd_module): Likewise. * grub-core/loader/powerpc/ieee1275/linux.c (grub_cmd_initrd): Likewise. * grub-core/loader/sparc64/ieee1275/linux.c (grub_cmd_initrd): Likewise. * grub-core/loader/xnu.c (grub_xnu_load_driver): Likewise. (grub_cmd_xnu_mkext): Likewise. (grub_cmd_xnu_ramdisk): Likewise. (grub_xnu_check_os_bundle_required): Likewise. (grub_xnu_load_kext_from_dir): Likewise. (grub_cmd_xnu_kextdir): Likewise. * grub-core/loader/xnu_resume.c (grub_xnu_resume): Likewise.
This commit is contained in:
parent
b2d004db18
commit
7a45a539db
13 changed files with 146 additions and 80 deletions
|
@ -25,6 +25,7 @@
|
|||
#include <grub/cpu/xnu.h>
|
||||
#include <grub/mm.h>
|
||||
#include <grub/loader.h>
|
||||
#include <grub/i18n.h>
|
||||
|
||||
static void *grub_xnu_hibernate_image;
|
||||
|
||||
|
@ -59,11 +60,13 @@ grub_xnu_resume (char *imagename)
|
|||
|
||||
/* Read the header. */
|
||||
if (grub_file_read (file, &hibhead, sizeof (hibhead))
|
||||
!=sizeof (hibhead))
|
||||
!= sizeof (hibhead))
|
||||
{
|
||||
grub_file_close (file);
|
||||
return grub_error (GRUB_ERR_READ_ERROR,
|
||||
"cannot read the hibernate header");
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_READ_ERROR,
|
||||
N_("premature end of file %s"), imagename);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
/* Check the header. */
|
||||
|
@ -138,7 +141,10 @@ grub_xnu_resume (char *imagename)
|
|||
!= (grub_ssize_t) codesize)
|
||||
{
|
||||
grub_file_close (file);
|
||||
return grub_error (GRUB_ERR_READ_ERROR, "cannot read resume image");
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_READ_ERROR,
|
||||
N_("premature end of file %s"), imagename);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
/* Read image. */
|
||||
|
@ -147,7 +153,10 @@ grub_xnu_resume (char *imagename)
|
|||
!= (grub_ssize_t) hibhead.image_size)
|
||||
{
|
||||
grub_file_close (file);
|
||||
return grub_error (GRUB_ERR_READ_ERROR, "cannot read resume image");
|
||||
if (!grub_errno)
|
||||
grub_error (GRUB_ERR_READ_ERROR,
|
||||
N_("premature end of file %s"), imagename);
|
||||
return grub_errno;
|
||||
}
|
||||
grub_file_close (file);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue