]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2008-04-07 Robert Millan <rmh@aybabtu.com>
authorrobertmh <robertmh@localhost>
Mon, 7 Apr 2008 15:00:27 +0000 (15:00 +0000)
committerrobertmh <robertmh@localhost>
Mon, 7 Apr 2008 15:00:27 +0000 (15:00 +0000)
        * util/biosdisk.c (read_device_map): Skip devices that don't exist
        (this prevents the presence of a bogus entry from ruining the whole
        thing).

ChangeLog
util/biosdisk.c

index 02023f62db45bf16bee48a197d78aa06786d6306..30d973c6c87c3468821f9653da2c8645045d06a5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2008-04-07  Robert Millan  <rmh@aybabtu.com>
+
+       * util/biosdisk.c (read_device_map): Skip devices that don't exist
+       (this prevents the presence of a bogus entry from ruining the whole
+       thing).
+
 2008-04-06  Pavel Roskin  <proski@gnu.org>
 
        * util/biosdisk.c: Include grub/util/biosdisk.h.
index 2d3d6017b302ac2f30d29656428229f62836585e..e6e7f51edb1a073f6746e99501fce06b18ad583a 100644 (file)
@@ -486,8 +486,9 @@ read_device_map (const char *dev_map)
   FILE *fp;
   char buf[1024];      /* XXX */
   int lineno = 0;
-  auto void show_error (const char *msg);
+  struct stat st;
 
+  auto void show_error (const char *msg);
   void show_error (const char *msg)
     {
       grub_util_error ("%s:%d: %s", dev_map, lineno, msg);
@@ -543,6 +544,12 @@ read_device_map (const char *dev_map)
       if (map[drive])
        show_error ("Duplicated entry found");
 
+      if (stat (p, &st) == -1)
+       {
+         grub_util_info ("Cannot stat `%s', skipping", p);
+         continue;
+       }
+
 #ifdef __linux__
       /* On Linux, the devfs uses symbolic links horribly, and that
         confuses the interface very much, so use realpath to expand