Skip to content

Commit

Permalink
scripts/kallsyms: Enable error messages while hush up unnecessary war…
Browse files Browse the repository at this point in the history
…nings

As no error was handled, we wouldn't be able to know when an error does
occur. The fix preserves error messages while it doesn't let unnecessary
compiling warnings show up.

Signed-off-by: Jean Sacren <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
sacren authored and michal42 committed Sep 29, 2010
1 parent 60eab87 commit ef89487
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions scripts/kallsyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,8 @@ static int read_symbol(FILE *in, struct sym_entry *s)

rc = fscanf(in, "%llx %c %499s\n", &s->addr, &stype, str);
if (rc != 3) {
if (rc != EOF) {
/* skip line. sym is used as dummy to
* shut of "warn_unused_result" warning.
*/
sym = fgets(str, 500, in);
}
if (rc != EOF && fgets(str, 500, in) == NULL)
fprintf(stderr, "Read error or end of file.\n");
return -1;
}

Expand Down

0 comments on commit ef89487

Please sign in to comment.