mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Marek Belisko <marek.belisko@open-nandra.com>
To: barebox@lists.infradead.org
Cc: Marek Belisko <marek.belisko@open-nandra.com>
Subject: [PATCH 3/3] scripts: Fix compilation warning.
Date: Mon,  2 May 2011 21:52:59 +0200	[thread overview]
Message-ID: <1304365979-5546-3-git-send-email-marek.belisko@open-nandra.com> (raw)
In-Reply-To: <1304365979-5546-1-git-send-email-marek.belisko@open-nandra.com>

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@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


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      parent reply	other threads:[~2011-05-02 19:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-02 19:52 [PATCH 1/3] arm: eukrea: " Marek Belisko
2011-05-02 19:52 ` [PATCH 2/3] arm: karo-tx25: " Marek Belisko
2011-05-02 19:52 ` Marek Belisko [this message]

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=1304365979-5546-3-git-send-email-marek.belisko@open-nandra.com \
    --to=marek.belisko@open-nandra.com \
    --cc=barebox@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