From 76a0f40fd6eff1bce3b91925cea7587b3399fe80 Mon Sep 17 00:00:00 2001 From: Frederic Weisbecker Date: Thu, 4 Jun 2009 22:15:58 +0200 Subject: [PATCH] perf_counter tools: Fix warn_unused_result warnings MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix warnings for return values that we don't care about: util/quote.c:222: attention : ignoring return value of ‘fwrite’, declared with attribute warn_unused_result util/quote.c:235: attention : ignoring return value of ‘fwrite’, declared with attribute warn_unused_result util/quote.c: In function ‘write_name_quotedpfx’: util/quote.c:290: attention : ignoring return value of ‘fwrite’, declared with attribute warn_unused_result Signed-off-by: Frederic Weisbecker Cc: Peter Zijlstra Cc: Mike Galbraith Cc: Paul Mackerras Cc: Corey Ashford Cc: Marcelo Tosatti Cc: Arnaldo Carvalho de Melo Cc: Frederic Weisbecker LKML-Reference: <1244146558-8635-1-git-send-email-fweisbec@gmail.com> Signed-off-by: Ingo Molnar --- Documentation/perf_counter/util/quote.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Documentation/perf_counter/util/quote.c b/Documentation/perf_counter/util/quote.c index 7a49fcf69671..f18c5212bc92 100644 --- a/Documentation/perf_counter/util/quote.c +++ b/Documentation/perf_counter/util/quote.c @@ -201,8 +201,9 @@ static size_t quote_c_style_counted(const char *name, ssize_t maxlen, } while (0) #define EMITBUF(s, l) \ do { \ + int __ret; \ if (sb) strbuf_add(sb, (s), (l)); \ - if (fp) fwrite((s), (l), 1, fp); \ + if (fp) __ret = fwrite((s), (l), 1, fp); \ count += (l); \ } while (0) @@ -287,7 +288,9 @@ extern void write_name_quotedpfx(const char *pfx, size_t pfxlen, quote_c_style(name, NULL, fp, 1); fputc('"', fp); } else { - fwrite(pfx, pfxlen, 1, fp); + int ret; + + ret = fwrite(pfx, pfxlen, 1, fp); fputs(name, fp); } fputc(terminator, fp); -- 2.20.1