From bb5e01017e57aeb301631aedb4bc60b26cdfc3f3 Mon Sep 17 00:00:00 2001 From: Marek Belisko Date: Mon, 2 May 2011 21:52:59 +0200 Subject: scripts: Fix compilation warning. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix following warning: scripts/kallsyms.c: In function ‘read_symbol’: scripts/kallsyms.c:81:9: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result Solution overtaken from kernel tree. Signed-off-by: Marek Belisko Signed-off-by: Sascha Hauer --- scripts/kallsyms.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'scripts') diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c index 1f11d84853..b3591a916b 100644 --- a/scripts/kallsyms.c +++ b/scripts/kallsyms.c @@ -76,10 +76,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 */ - fgets(str, 500, in); - } + if (rc != EOF && fgets(str, 500, in) == NULL) + fprintf(stderr, "Read error or end of file.\n"); return -1; } -- cgit v1.2.3