diff options
author | Bill Nottingham <notting@redhat.com> | 2000-12-04 05:56:46 +0000 |
---|---|---|
committer | Bill Nottingham <notting@redhat.com> | 2000-12-04 05:56:46 +0000 |
commit | c6a7da819887b742151c8658691272777b5806d5 (patch) | |
tree | d17d15ceb5fa9ab69bb285c6adc6703aef131e0d /isys | |
parent | 9391af839fd089e198fec6e5af4fdd965b9eafdd (diff) | |
download | anaconda-c6a7da819887b742151c8658691272777b5806d5.tar.gz anaconda-c6a7da819887b742151c8658691272777b5806d5.tar.xz anaconda-c6a7da819887b742151c8658691272777b5806d5.zip |
fix compaq smart array stuff on 2.4
Diffstat (limited to 'isys')
-rw-r--r-- | isys/probe.c | 38 |
1 files changed, 30 insertions, 8 deletions
diff --git a/isys/probe.c b/isys/probe.c index a8574bf54..57e367be5 100644 --- a/isys/probe.c +++ b/isys/probe.c @@ -477,11 +477,21 @@ static int CompaqSmartArrayGetDevices(struct knownDevices * devices) { char buf[256]; char *ptr; int numMatches = 0, ctlNum = 0; - char ctl[40]; + char ctl[64]; + char *path; + + path = "/proc/driver/ida"; - sprintf(ctl, "/proc/array/ida%d", ctlNum++); + sprintf(ctl, "%s/ida%d", path, ctlNum++); - while ((f = fopen(ctl, "r"))){ + f = fopen(ctl, "r"); + if (!f) { + path = "/proc/ida"; + sprintf(ctl, "%s/ida%d", path, ctlNum++); + f = fopen(ctl, "r"); + } + + if (f) { while (fgets(buf, sizeof(buf) - 1, f)) { if (!strncmp(buf, "ida/", 4)) { ptr = strchr(buf, ':'); @@ -495,8 +505,9 @@ static int CompaqSmartArrayGetDevices(struct knownDevices * devices) { } } } - sprintf(ctl, "/proc/array/ida%d", ctlNum++); + sprintf(ctl, "%s/ida%d", path, ctlNum++); } + fclose(f); return 0; } @@ -507,11 +518,21 @@ static int CompaqSmartArray5300GetDevices(struct knownDevices * devices) { char buf[256]; char *ptr; int numMatches = 0, ctlNum = 0; - char ctl[40]; + char ctl[64]; + char *path; + + path = "/proc/driver/cciss"; - sprintf(ctl, "/proc/cciss/cciss%d", ctlNum++); + sprintf(ctl, "%s/cciss%d", path, ctlNum++); - while ((f = fopen(ctl, "r"))){ + f = fopen(ctl, "r"); + if (!f) { + path = "/proc/cciss"; + sprintf(ctl, "%s/cciss%d", path, ctlNum++); + f = fopen(ctl, "r"); + } + + if (f) { while (fgets(buf, sizeof(buf) - 1, f)) { if (!strncmp(buf, "cciss/", 6)) { ptr = strchr(buf, ':'); @@ -525,8 +546,9 @@ static int CompaqSmartArray5300GetDevices(struct knownDevices * devices) { } } } - sprintf(ctl, "/proc/cciss/cciss%d", ctlNum++); + sprintf(ctl, "%s/cciss%d", path, ctlNum++); } + fclose(f); return 0; } |