From: Ben Dooks <ben-linux@fluff.org>
To: linux-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org
Cc: Ben Dooks <ben-linux@fluff.org>
Subject: [PATCH] kbuild: kallsysms: throw away result of fgets()
Date: Tue, 25 May 2010 01:50:59 +0100 [thread overview]
Message-ID: <1274748661-15253-2-git-send-email-ben-linux@fluff.org> (raw)
In-Reply-To: <1274748661-15253-1-git-send-email-ben-linux@fluff.org>
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@fluff.org>
---
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
next prev parent reply other threads:[~2010-05-25 0:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-25 0:50 kbuild warning fixes Ben Dooks
2010-05-25 0:50 ` Ben Dooks [this message]
2010-05-25 0:51 ` [PATCH] kbuild: kallsysms: throw away result of fgets() Ben Dooks
2010-05-25 0:51 ` [PATCH 190/190] kbuild: fix unused return value from fgets() Ben Dooks
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1274748661-15253-2-git-send-email-ben-linux@fluff.org \
--to=ben-linux@fluff.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).