[PATCH] kbuild: kallsysms: throw away result of fgets()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



fgets() is being used to skip a line, so throw the result away
to remove the following warning:

scripts/kallsyms.c: In function ‘read_symbol’:
scripts/kallsyms.c:112: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result

Signed-off-by: Ben Dooks <ben-linux@xxxxxxxxx>

---
 scripts/kallsyms.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/scripts/kallsyms.c b/scripts/kallsyms.c
index 86c3896..87c3d38 100644
--- a/scripts/kallsyms.c
+++ b/scripts/kallsyms.c
@@ -109,7 +109,11 @@ static int read_symbol(FILE *in, struct sym_entry *s)
 	if (rc != 3) {
 		if (rc != EOF) {
 			/* skip line */
-			fgets(str, 500, in);
+			char *tmp = fgets(str, 500, in);
+
+			/* shut unused-result warning up */
+			if (!tmp)
+				str[0] = '\0';
 		}
 		return -1;
 	}
-- 
1.6.3.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kbuild" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux