diff --git a/ChangeLog b/ChangeLog index f65b1995a..988db64be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2003-11-30 Yoshinori K. Okuji + + * lib/device.c (read_device_map) (sho_warning): New internal + function. + (read_device_map): If DRIVE is greater than 8, emit a warning + and ignore the drive, rather than exiting abnormally. + Reported by Greg Newby . + 2003-10-19 Yoshinori K. Okuji Migrated to newer autotools. Also, don't install mkbimage diff --git a/lib/device.c b/lib/device.c index a88a2db90..69a8dab4f 100644 --- a/lib/device.c +++ b/lib/device.c @@ -34,6 +34,7 @@ #include #include #include +#include #ifdef __linux__ # if !defined(__GLIBC__) || \ @@ -395,6 +396,16 @@ read_device_map (FILE *fp, char **map, const char *map_file) fprintf (stderr, "%s:%d: error: %s\n", map_file, no, msg); } + static void show_warning (int no, const char *msg, ...) + { + va_list ap; + + va_start (ap, msg); + fprintf (stderr, "%s:%d: warning: ", map_file, no); + vfprintf (stderr, msg, ap); + va_end (ap); + } + /* If there is the device map file, use the data in it instead of probing devices. */ char buf[1024]; /* XXX */ @@ -440,11 +451,18 @@ read_device_map (FILE *fp, char **map, const char *map_file) ptr += 2; drive = strtoul (ptr, &ptr, 10); - if (drive < 0 || drive > 8) + if (drive < 0) { show_error (line_number, "Bad device number"); return 0; } + else if (drive > 8) + { + show_warning (line_number, + "Ignoring %cd%d due to a BIOS limitation", + is_floppy ? 'f' : 'h', drive); + continue; + } if (! is_floppy) drive += 0x80;