2003-11-30 Yoshinori K. Okuji <okuji@enbug.org>
* 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 <newby@arsc.edu>.
This commit is contained in:
parent
49597fd5cb
commit
3b2816320b
2 changed files with 27 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2003-11-30 Yoshinori K. Okuji <okuji@enbug.org>
|
||||||
|
|
||||||
|
* 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 <newby@arsc.edu>.
|
||||||
|
|
||||||
2003-10-19 Yoshinori K. Okuji <okuji@enbug.org>
|
2003-10-19 Yoshinori K. Okuji <okuji@enbug.org>
|
||||||
|
|
||||||
Migrated to newer autotools. Also, don't install mkbimage
|
Migrated to newer autotools. Also, don't install mkbimage
|
||||||
|
|
20
lib/device.c
20
lib/device.c
|
@ -34,6 +34,7 @@
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
#include <stdarg.h>
|
||||||
|
|
||||||
#ifdef __linux__
|
#ifdef __linux__
|
||||||
# if !defined(__GLIBC__) || \
|
# 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);
|
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
|
/* If there is the device map file, use the data in it instead of
|
||||||
probing devices. */
|
probing devices. */
|
||||||
char buf[1024]; /* XXX */
|
char buf[1024]; /* XXX */
|
||||||
|
@ -440,11 +451,18 @@ read_device_map (FILE *fp, char **map, const char *map_file)
|
||||||
|
|
||||||
ptr += 2;
|
ptr += 2;
|
||||||
drive = strtoul (ptr, &ptr, 10);
|
drive = strtoul (ptr, &ptr, 10);
|
||||||
if (drive < 0 || drive > 8)
|
if (drive < 0)
|
||||||
{
|
{
|
||||||
show_error (line_number, "Bad device number");
|
show_error (line_number, "Bad device number");
|
||||||
return 0;
|
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)
|
if (! is_floppy)
|
||||||
drive += 0x80;
|
drive += 0x80;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue