summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorJean Sacren <sakiwit@gmail.com>2010-09-10 23:13:33 -0600
committerMichal Marek <mmarek@suse.cz>2010-09-29 16:18:27 +0200
commitef894870c6c38580e540c29cfb22a827d54a950a (patch)
treeb1065bc4e2e637aa2c80a07040636b0e9a98de7e /scripts
parent60eab877a9581b479c6c7d7913ce8070a0ace960 (diff)
downloadlwn-ef894870c6c38580e540c29cfb22a827d54a950a.tar.gz
lwn-ef894870c6c38580e540c29cfb22a827d54a950a.zip
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>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kallsyms.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index e3902fb39afd..60dd3eb9366e 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -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;
}