add open_read_close() and similar stuff

This commit is contained in:
Denis Vlasenko
2006-10-14 02:23:43 +00:00
parent 88ca067690
commit ea62077b85
38 changed files with 228 additions and 234 deletions

View File

@ -147,9 +147,8 @@ int lsmod_main(int argc, char **argv)
check_tainted();
#if defined(CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT)
{
char line[4096];
while (fgets(line, sizeof(line), file)) {
char *line;
while ((line = xmalloc_fgets(file)) != NULL) {
char *tok;
tok = strtok(line, " \t");
@ -175,7 +174,8 @@ int lsmod_main(int argc, char **argv)
tok = "";
printf(" %s", tok);
}
printf("\n");
puts("");
free(line);
}
fclose(file);
}