2010-01-04 Robert Millan <rmh.grub@aybabtu.com>
* commands/crc.c (grub_cmd_crc): Abort on read errors. * fs/iso9660.c (grub_iso9660_read): Check for read error and pass it to upper layer.
This commit is contained in:
parent
52c2d97f26
commit
732c47f005
2 changed files with 10 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
|||
/* crc.c - command to calculate the crc32 checksum of a file */
|
||||
/*
|
||||
* GRUB -- GRand Unified Bootloader
|
||||
* Copyright (C) 2008 Free Software Foundation, Inc.
|
||||
* Copyright (C) 2008,2010 Free Software Foundation, Inc.
|
||||
*
|
||||
* GRUB is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
@ -46,10 +46,13 @@ grub_cmd_crc (grub_command_t cmd __attribute__ ((unused)),
|
|||
while ((size = grub_file_read (file, buf, sizeof (buf))) > 0)
|
||||
crc = grub_getcrc32 (crc, buf, size);
|
||||
|
||||
grub_file_close (file);
|
||||
if (grub_errno)
|
||||
goto fail;
|
||||
|
||||
grub_printf ("%08x\n", crc);
|
||||
|
||||
fail:
|
||||
grub_file_close (file);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue