summaryrefslogtreecommitdiffstats
path: root/isys
diff options
context:
space:
mode:
authorErik Troan <ewt@redhat.com>2001-03-06 21:34:50 +0000
committerErik Troan <ewt@redhat.com>2001-03-06 21:34:50 +0000
commita04ff25160736a690912c51de6110a2c7bf63a61 (patch)
treea95f4c1134544acda5bbd9ff90b8581390366b5b /isys
parent2df511238a83542c073d880e1bc2bad98ddbdc14 (diff)
downloadanaconda-a04ff25160736a690912c51de6110a2c7bf63a61.tar.gz
anaconda-a04ff25160736a690912c51de6110a2c7bf63a61.tar.xz
anaconda-a04ff25160736a690912c51de6110a2c7bf63a61.zip
merges didn't merge properly! (bugzilla 30733)
Diffstat (limited to 'isys')
-rw-r--r--isys/moduleinfo.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/isys/moduleinfo.c b/isys/moduleinfo.c
index 5eadbdb3d..c3e0b95a7 100644
--- a/isys/moduleinfo.c
+++ b/isys/moduleinfo.c
@@ -6,6 +6,8 @@
#include <sys/stat.h>
#include <unistd.h>
+#include <stdio.h>
+
#include "isys.h"
struct moduleInfo * isysGetModuleList(moduleInfoSet mis,
@@ -70,10 +72,13 @@ int isysReadModuleInfo(const char * filename, moduleInfoSet mis, void * ident) {
fstat(fd, &sb);
buf = alloca(sb.st_size + 1);
- read(fd, buf, sb.st_size);
+ i = read(fd, buf, sb.st_size);
buf[sb.st_size] = '\0';
close(fd);
+ if (i != sb.st_size)
+ return -1;
+
nextModule = NULL;
modulesAlloced = mis->numModules;
@@ -103,8 +108,9 @@ int isysReadModuleInfo(const char * filename, moduleInfoSet mis, void * ident) {
if (*start != '\n' && *start && *start != '#') {
if (!isIndented) {
if (nextModule && nextModule->moduleName &&
- nextModule == (mis->moduleList + mis->numModules))
- mis->numModules++;
+ nextModule == (mis->moduleList + mis->numModules)) {
+ mis->numModules++;
+ }
if (mis->numModules == modulesAlloced) {
modulesAlloced += 5;
@@ -193,8 +199,9 @@ int isysReadModuleInfo(const char * filename, moduleInfoSet mis, void * ident) {
start = next;
}
- if (nextModule && nextModule->moduleName) nextModule++;
- mis->numModules = (nextModule - mis->moduleList);
+ /* do we need to add in this last module? */
+ if ((nextModule - mis->moduleList) == mis->numModules)
+ mis->numModules++;
return 0;
}