summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2010-03-03 20:16:39 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2010-03-03 20:16:39 +0000
commita7946d0522fcfd89b58ccd2d2948729b7e4c66b1 (patch)
treeb75ddda699fe1874d09007e7f174d6f5a6351165 /mdk-stage1
parente372bf9afee9e71e3d8edc8b23a20e67a6005c3b (diff)
downloaddrakx-a7946d0522fcfd89b58ccd2d2948729b7e4c66b1.tar
drakx-a7946d0522fcfd89b58ccd2d2948729b7e4c66b1.tar.gz
drakx-a7946d0522fcfd89b58ccd2d2948729b7e4c66b1.tar.bz2
drakx-a7946d0522fcfd89b58ccd2d2948729b7e4c66b1.tar.xz
drakx-a7946d0522fcfd89b58ccd2d2948729b7e4c66b1.zip
actually go through all procfiles to detect Compaq Smart Array in stead of only
checking the first (yeay, 8 years and 6 months old bug fixed! \o/)
Diffstat (limited to 'mdk-stage1')
-rw-r--r--mdk-stage1/probing.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/mdk-stage1/probing.c b/mdk-stage1/probing.c
index 3052b2823..55769e87f 100644
--- a/mdk-stage1/probing.c
+++ b/mdk-stage1/probing.c
@@ -800,23 +800,25 @@ void find_media(enum media_bus bus)
static char cpq_descr[] = "Compaq RAID logical disk";
char ** procfile = procfiles;
FILE * f;
- while (procfile && *procfile && (f = fopen(*procfile, "rb"))) {
- while (fgets(buf, sizeof(buf), f)) {
- if (ptr_begins_static_str(buf, "ida/") || ptr_begins_static_str(buf, "cciss/")) {
- char * end = strchr(buf, ':');
- if (!end)
- log_message("Inconsistency in %s, line:\n%s", *procfile, buf);
- else {
- *end = '\0';
- tmp[count].name = strdup(buf);
- tmp[count].type = DISK;
- tmp[count].model = cpq_descr;
- log_message("CPQ: found %s", tmp[count].name);
- count++;
+ while (procfile && *procfile) {
+ if(f = fopen(*procfile, "rb")) {
+ while (fgets(buf, sizeof(buf), f)) {
+ if (ptr_begins_static_str(buf, "ida/") || ptr_begins_static_str(buf, "cciss/")) {
+ char * end = strchr(buf, ':');
+ if (!end)
+ log_message("Inconsistency in %s, line:\n%s", *procfile, buf);
+ else {
+ *end = '\0';
+ tmp[count].name = strdup(buf);
+ tmp[count].type = DISK;
+ tmp[count].model = cpq_descr;
+ log_message("CPQ: found %s", tmp[count].name);
+ count++;
+ }
}
}
+ fclose(f);
}
- fclose(f);
procfile++;
}
}