gpt: allow repair function to noop
Simplifies usage a little.
This commit is contained in:
parent
3dda6a863a
commit
f4e09602dc
2 changed files with 6 additions and 3 deletions
|
@ -91,7 +91,6 @@ grub_find_next (const char *disk_name,
|
||||||
if (!gpt)
|
if (!gpt)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
if (!grub_gpt_both_valid(gpt))
|
|
||||||
if (grub_gpt_repair (dev->disk, gpt))
|
if (grub_gpt_repair (dev->disk, gpt))
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
|
|
|
@ -579,6 +579,10 @@ grub_gpt_repair (grub_disk_t disk, grub_gpt_t gpt)
|
||||||
{
|
{
|
||||||
grub_uint64_t backup_header, backup_entries;
|
grub_uint64_t backup_header, backup_entries;
|
||||||
|
|
||||||
|
/* Skip if there is nothing to do. */
|
||||||
|
if (grub_gpt_both_valid (gpt))
|
||||||
|
return GRUB_ERR_NONE;
|
||||||
|
|
||||||
grub_dprintf ("gpt", "repairing GPT for %s\n", disk->name);
|
grub_dprintf ("gpt", "repairing GPT for %s\n", disk->name);
|
||||||
|
|
||||||
if (disk->log_sector_size != gpt->log_sector_size)
|
if (disk->log_sector_size != gpt->log_sector_size)
|
||||||
|
|
Loading…
Add table
Reference in a new issue