[1831] 2008-08-28 Robert Millan <[email protected]>

Robert Millan <[email protected]>
Newsgroups gmane.comp.boot-loaders.grub.cvs
Message-ID <[email protected]>
Revision: 1831
          http://svn.sv.gnu.org/viewvc/?view=rev&root=grub&revision=1831
Author:   robertmh
Date:     2008-08-28 14:36:18 +0000 (Thu, 28 Aug 2008)

Log Message:
-----------
2008-08-28  Robert Millan  <[email protected]>

        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.

Modified Paths:
--------------
    trunk/grub2/ChangeLog
    trunk/grub2/util/biosdisk.c

Modified: trunk/grub2/ChangeLog
===================================================================
--- trunk/grub2/ChangeLog	2008-08-27 15:05:00 UTC (rev 1830)
+++ trunk/grub2/ChangeLog	2008-08-28 14:36:18 UTC (rev 1831)
@@ -1,3 +1,13 @@
+2008-08-28  Robert Millan  <[email protected]>
+
+	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  <[email protected]>
 
 	* conf/common.rmk (pkglib_MODULES): Add scsi.mod.

Modified: trunk/grub2/util/biosdisk.c
===================================================================
--- trunk/grub2/util/biosdisk.c	2008-08-27 15:05:00 UTC (rev 1830)
+++ trunk/grub2/util/biosdisk.c	2008-08-28 14:36:18 UTC (rev 1831)
@@ -120,17 +120,21 @@
 	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;
+}
+
+static int
 grub_util_biosdisk_iterate (int (*hook) (const char *name))
 {
   unsigned i;
@@ -503,7 +507,7 @@
 
       p++;
       /* Find a free slot.  */
-      drive = find_grub_drive (NULL);
+      drive = find_free_slot ();
       if (drive < 0)
 	show_error ("Map table size exceeded");
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.