Skip to content

Commit

Permalink
perf_counter tools: Fix warn_unused_result warnings
Browse files Browse the repository at this point in the history
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 <fweisbec@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <1244146558-8635-1-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
  • Loading branch information
Frederic Weisbecker authored and Ingo Molnar committed Jun 4, 2009
1 parent 9ac9954 commit 76a0f40
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Documentation/perf_counter/util/quote.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 76a0f40

Please sign in to comment.