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).
This commit is contained in:
parent
36747a6221
commit
3cbd2f98c6
2 changed files with 14 additions and 1 deletions
|
@ -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>
|
2008-04-06 Pavel Roskin <proski@gnu.org>
|
||||||
|
|
||||||
* util/biosdisk.c: Include grub/util/biosdisk.h.
|
* util/biosdisk.c: Include grub/util/biosdisk.h.
|
||||||
|
|
|
@ -486,8 +486,9 @@ read_device_map (const char *dev_map)
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
char buf[1024]; /* XXX */
|
char buf[1024]; /* XXX */
|
||||||
int lineno = 0;
|
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)
|
void show_error (const char *msg)
|
||||||
{
|
{
|
||||||
grub_util_error ("%s:%d: %s", dev_map, lineno, 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])
|
if (map[drive])
|
||||||
show_error ("Duplicated entry found");
|
show_error ("Duplicated entry found");
|
||||||
|
|
||||||
|
if (stat (p, &st) == -1)
|
||||||
|
{
|
||||||
|
grub_util_info ("Cannot stat `%s', skipping", p);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
/* On Linux, the devfs uses symbolic links horribly, and that
|
/* On Linux, the devfs uses symbolic links horribly, and that
|
||||||
confuses the interface very much, so use realpath to expand
|
confuses the interface very much, so use realpath to expand
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue