fix a problem that chainloader doesn't report any error, even if it failed.

This commit is contained in:
okuji 2000-12-16 20:25:15 +00:00
parent 9f4cb39873
commit 47148b669b
2 changed files with 12 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2000-12-17 OKUJI Yoshinori <okuji@gnu.org>
* stage2/builtins.c (chainloader_func): Set ERRNUM to
ERR_EXEC_FORMAT, when ERRNUM is ERR_NONE, even if grub_read
fails in reading one sector.
2000-12-14 OKUJI Yoshinori <okuji@gnu.org> 2000-12-14 OKUJI Yoshinori <okuji@gnu.org>
* docs/prog-ref.texi (Partition types): Rewrite the footnotes. * docs/prog-ref.texi (Partition types): Rewrite the footnotes.

View file

@ -418,6 +418,12 @@ chainloader_func (char *arg, int flags)
{ {
grub_close (); grub_close ();
kernel_type = KERNEL_TYPE_NONE; kernel_type = KERNEL_TYPE_NONE;
/* This below happens, if a file whose size is less than 512 bytes
is loaded. */
if (errnum == ERR_NONE)
errnum = ERR_EXEC_FORMAT;
return 1; return 1;
} }