2008-08-28 Robert Millan <rmh@aybabtu.com>

Change find_grub_drive() syntax so it doesn't prevent it from
        detecting NULL names as errors.

        * util/biosdisk.c (find_grub_drive): Move free slot search code
        from here ...
        (find_free_slot): ... to here.
        (read_device_map): Use find_free_slot() to search for free slots.
This commit is contained in:
robertmh 2008-08-28 14:36:18 +00:00
parent 965c75ca69
commit 678e849cd3
2 changed files with 21 additions and 7 deletions

View File

@ -1,3 +1,13 @@
2008-08-28 Robert Millan <rmh@aybabtu.com>
Change find_grub_drive() syntax so it doesn't prevent it from
detecting NULL names as errors.
* util/biosdisk.c (find_grub_drive): Move free slot search code
from here ...
(find_free_slot): ... to here.
(read_device_map): Use find_free_slot() to search for free slots.
2008-08-27 Marco Gerards <marco@gnu.org>
* conf/common.rmk (pkglib_MODULES): Add scsi.mod.

View File

@ -120,12 +120,16 @@ find_grub_drive (const char *name)
if (map[i].drive && ! strcmp (map[i].drive, name))
return i;
}
else
{
for (i = 0; i < sizeof (map) / sizeof (map[0]); i++)
if (! map[i].drive)
return i;
}
return -1;
}
static int
find_free_slot ()
{
for (i = 0; i < sizeof (map) / sizeof (map[0]); i++)
if (! map[i].drive)
return i;
return -1;
}
@ -503,7 +507,7 @@ read_device_map (const char *dev_map)
p++;
/* Find a free slot. */
drive = find_grub_drive (NULL);
drive = find_free_slot ();
if (drive < 0)
show_error ("Map table size exceeded");