summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorPer Øyvind Karlsen <peroyvind@mandriva.org>2010-03-04 03:04:20 +0000
committerPer Øyvind Karlsen <peroyvind@mandriva.org>2010-03-04 03:04:20 +0000
commit6819c00e72491819f6861a25f435cca4e0bd2384 (patch)
treed0a064b8b5be321a5cbc326055b84851874671e6 /mdk-stage1
parenta7946d0522fcfd89b58ccd2d2948729b7e4c66b1 (diff)
downloaddrakx-6819c00e72491819f6861a25f435cca4e0bd2384.tar
drakx-6819c00e72491819f6861a25f435cca4e0bd2384.tar.gz
drakx-6819c00e72491819f6861a25f435cca4e0bd2384.tar.bz2
drakx-6819c00e72491819f6861a25f435cca4e0bd2384.tar.xz
drakx-6819c00e72491819f6861a25f435cca4e0bd2384.zip
* using a for loop looks better
* fix warning about not using parenthesis
Diffstat (limited to 'mdk-stage1')
-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++;
}
}