[PATCH 3/3] scripts: Fix compilation warning.

Marek Belisko marek.belisko at open-nandra.com
Mon May 2 15:52:59 EDT 2011


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 <marek.belisko at open-nandra.com>
---
 scripts/kallsyms.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 1f11d84..b3591a9 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;
 	}
 
-- 
1.7.4.1




More information about the barebox mailing list