diff options
author | Erik Troan <ewt@redhat.com> | 2001-03-06 21:34:50 +0000 |
---|---|---|
committer | Erik Troan <ewt@redhat.com> | 2001-03-06 21:34:50 +0000 |
commit | a04ff25160736a690912c51de6110a2c7bf63a61 (patch) | |
tree | a95f4c1134544acda5bbd9ff90b8581390366b5b /isys/moduleinfo.c | |
parent | 2df511238a83542c073d880e1bc2bad98ddbdc14 (diff) | |
download | anaconda-a04ff25160736a690912c51de6110a2c7bf63a61.tar.gz anaconda-a04ff25160736a690912c51de6110a2c7bf63a61.tar.xz anaconda-a04ff25160736a690912c51de6110a2c7bf63a61.zip |
merges didn't merge properly! (bugzilla 30733)
Diffstat (limited to 'isys/moduleinfo.c')
-rw-r--r-- | isys/moduleinfo.c | 17 |
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; } |