summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mdk-stage1/probing.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/mdk-stage1/probing.c b/mdk-stage1/probing.c
index 55769e87f..7d97056a4 100644
--- a/mdk-stage1/probing.c
+++ b/mdk-stage1/probing.c
@@ -798,10 +798,10 @@ void find_media(enum media_bus bus)
"/proc/array/ida", "/proc/cciss/cciss", // 2.2 style
NULL };
static char cpq_descr[] = "Compaq RAID logical disk";
- char ** procfile = procfiles;
+ char ** procfile;
FILE * f;
- while (procfile && *procfile) {
- if(f = fopen(*procfile, "rb")) {
+ for (procfile = procfiles; procfile && *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, ':');
@@ -819,7 +819,6 @@ void find_media(enum media_bus bus)
}
fclose(f);
}
- procfile++;
}
}