From b9fd8c1fdbe0b118e29494366c9aac0545c8e1fe Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Fri, 29 Dec 2000 03:10:45 +0000 Subject: [PATCH] ChangeLog, base_device.c, fsck.c: base_device.c (base_device): Add support for DAC960 device names. fsck.c (device_already_active): Handle the case where base_device doesn't know how to interpret the device name, instead of core dumping. --- misc/ChangeLog | 9 +++++++++ misc/base_device.c | 10 ++++++++++ misc/fsck.c | 2 ++ 3 files changed, 21 insertions(+) diff --git a/misc/ChangeLog b/misc/ChangeLog index d6f5327..f13d499 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,12 @@ +2000-12-28 + + * base_device.c (base_device): Add support for DAC960 device + names. + + * fsck.c (device_already_active): Handle the case where + base_device doesn't know how to interpret the device name, + instead of core dumping. + 2000-12-09 * mke2fs.c (main, parse_journal_opts): Add support for creating V1 diff --git a/misc/base_device.c b/misc/base_device.c index 03008cb..f58f2e8 100644 --- a/misc/base_device.c +++ b/misc/base_device.c @@ -68,6 +68,16 @@ char *base_device(char *device) return str; } + /* Handle DAC 960 devices */ + if (strncmp(cp, "rd/", 3) == 0) { + cp += 3; + if (cp[0] != 'c' || cp[2] != 'd' || + !isdigit(cp[1]) || !isdigit(cp[3])) + goto errout; + *(cp+4) = 0; + return str; + } + /* Now let's handle /dev/hd* and /dev/sd* devices.... */ if ((cp[0] == 'h' || cp[0] == 's') && (cp[1] == 'd')) { cp += 2; diff --git a/misc/fsck.c b/misc/fsck.c index 8fc4610..6ff0ec2 100644 --- a/misc/fsck.c +++ b/misc/fsck.c @@ -698,6 +698,8 @@ static int device_already_active(char *device) #endif base = base_device(device); + if (!base) + return 0; for (inst = instance_list; inst; inst = inst->next) { if (!strcmp(base, inst->base_device)) { free(base); -- 1.8.3.1