summaryrefslogtreecommitdiffstats
path: root/isys/eddsupport.c
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2007-10-19 17:29:40 +0000
committerPeter Jones <pjones@redhat.com>2007-10-19 17:29:40 +0000
commita2fdee013c35e3b68a52616f3cc8b8adf7b58688 (patch)
tree121d37e1a037dfdeb7b4f536675ef969ba490684 /isys/eddsupport.c
parent0e917057bea03b3e897db2117b0ec982a098b254 (diff)
downloadanaconda-a2fdee013c35e3b68a52616f3cc8b8adf7b58688.tar.gz
anaconda-a2fdee013c35e3b68a52616f3cc8b8adf7b58688.tar.xz
anaconda-a2fdee013c35e3b68a52616f3cc8b8adf7b58688.zip
- fix missing close() calls
- reformat some edd code
Diffstat (limited to 'isys/eddsupport.c')
-rw-r--r--isys/eddsupport.c51
1 files changed, 27 insertions, 24 deletions
diff --git a/isys/eddsupport.c b/isys/eddsupport.c
index 267fa1d93..0924af0f5 100644
--- a/isys/eddsupport.c
+++ b/isys/eddsupport.c
@@ -164,6 +164,7 @@ static int mapBiosDisks(struct device** devices,const char *path) {
#ifdef STANDALONE
fprintf(stderr, "Error initializing mbrSigToName table\n");
#endif
+ closedir(dirHandle);
return 0;
}
@@ -176,31 +177,33 @@ static int mapBiosDisks(struct device** devices,const char *path) {
sigFileName = malloc(strlen(path) + strlen(entry->d_name) + 20);
sprintf(sigFileName, "%s/%s/%s", path, entry->d_name, SIG_FILE);
if (readMbrSig(sigFileName, &mbrSig) == 0) {
-
- for (currentDev = devices, i = 0, foundDisk=NULL; (*currentDev) != NULL && i<2; currentDev++) {
- if (!(*currentDev)->device)
- continue;
-
- if ((rc=readDiskSig((*currentDev)->device, &currentSig)) < 0){
- if (rc == -ENOMEDIUM)
- continue;
- return 0;
- }
-
-
- if (mbrSig == currentSig){
- foundDisk=currentDev;
- i++;
- }
- }
-
- if (i==1){
- if(!addToHashTable(mbrSigToName, (uint32_t)biosNum,
- (*foundDisk)->device))
- return 0;
- }
+ for (currentDev = devices, i = 0, foundDisk=NULL;
+ (*currentDev) != NULL && i<2;
+ currentDev++) {
+ if (!(*currentDev)->device)
+ continue;
+
+ if ((rc=readDiskSig((*currentDev)->device, &currentSig)) < 0) {
+ if (rc == -ENOMEDIUM)
+ continue;
+ closedir(dir);
+ return 0;
+ }
+
+ if (mbrSig == currentSig) {
+ foundDisk=currentDev;
+ i++;
+ }
+ }
+
+ if (i==1) {
+ if(!addToHashTable(mbrSigToName, (uint32_t)biosNum,
+ (*foundDisk)->device)) {
+ closedir(dirHandle);
+ return 0;
+ }
+ }
}
-
}
closedir(dirHandle);
return 1;