perfcounter: fix unhandled io return value
PATCH 1/1 perfcounter: fix unhandled io return value
Building latest perfcounter fails on the following error:
cc1: warnings being treated as errorsbuiltin-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 <[email protected]>
--- tools/perf/builtin-record.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
tools/perf/builtin-record.c +4 -1
@@ -448,7 +448,10 @@ try_again: } } -read (fd[nr_cpu][counter], &read_data,sizeof (read_data)); +if (read (fd[nr_cpu][counter], &read_data,sizeof (read_data)) ==-1 ) { +perror ("Unable to read perf file descriptor\n" ); +exit (-1 ); + }perf_header_attr__add_id (h_attr, read_data.id);
Signature · 1 line
1.6.2.3