diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-06-25 16:21:27 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-06-25 16:25:55 -0400 |
commit | 3928ddbe994cce1da1b6365b0db04d5765f254f4 (patch) | |
tree | 23419e9b7bb39be5296ef30b8c828ce1bf44f297 | |
parent | 4418351f06d9ce73acc846158c20186965f920f3 (diff) |
perf record: Fix unhandled io return value
Building latest perfcounter fails on the following error:
builtin-record.c: In function ‘create_counter’:
builtin-record.c:451: erreur: ignoring return value of ‘read’, declared with attribute warn_unused_result
make: *** [builtin-record.o] Erreur 1
Just check if we successfully read the perf file descriptor.
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: Frederic Weisbecker <fweisbec@gmail.com>
LKML-Reference: <1245961287-5327-1-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
-rw-r--r-- | tools/perf/builtin-record.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 798a56d890e5..d18546f37d7c 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c | |||
@@ -448,7 +448,10 @@ try_again: | |||
448 | } | 448 | } |
449 | } | 449 | } |
450 | 450 | ||
451 | read(fd[nr_cpu][counter], &read_data, sizeof(read_data)); | 451 | if (read(fd[nr_cpu][counter], &read_data, sizeof(read_data)) == -1) { |
452 | perror("Unable to read perf file descriptor\n"); | ||
453 | exit(-1); | ||
454 | } | ||
452 | 455 | ||
453 | perf_header_attr__add_id(h_attr, read_data.id); | 456 | perf_header_attr__add_id(h_attr, read_data.id); |
454 | 457 | ||