Commit ef894870c6c38580e540c29cfb22a827d54a950a
Committed by
Michal Marek
1 parent
60eab877a9
Exists in
master
and in
7 other branches
scripts/kallsyms: Enable error messages while hush up unnecessary warnings
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 <sakiwit@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
Showing 1 changed file with 2 additions and 6 deletions Side-by-side Diff
scripts/kallsyms.c
... | ... | @@ -107,12 +107,8 @@ |
107 | 107 | |
108 | 108 | rc = fscanf(in, "%llx %c %499s\n", &s->addr, &stype, str); |
109 | 109 | if (rc != 3) { |
110 | - if (rc != EOF) { | |
111 | - /* skip line. sym is used as dummy to | |
112 | - * shut of "warn_unused_result" warning. | |
113 | - */ | |
114 | - sym = fgets(str, 500, in); | |
115 | - } | |
110 | + if (rc != EOF && fgets(str, 500, in) == NULL) | |
111 | + fprintf(stderr, "Read error or end of file.\n"); | |
116 | 112 | return -1; |
117 | 113 | } |
118 | 114 |