Skip to content

Commit

Permalink
perf-counter: fix compiler warnings
Browse files Browse the repository at this point in the history
Gcc complains about:
lib/perf-counter.c:43:13: error: ignoring return value of 'read',
declared with attribute warn_unused_result [-Werror=unused-result]
         read(fd__, counter, sizeof(*counter));

Signed-off-by: Andy Zhou <[email protected]>
Acked-by: Russell Bryant <[email protected]>
  • Loading branch information
azhou-nicira committed Apr 14, 2015
1 parent 60ceeb6 commit 296527d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/perf-counter.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ static int fd__ = 0;
uint64_t
perf_counter_read(uint64_t *counter)
{
if (fd__ > 0) {
read(fd__, counter, sizeof(*counter));
} else {
size_t size = sizeof *counter;

if (fd__ <= 0 || read(fd__, counter, size) < size) {
*counter = 0;
}

Expand Down

0 comments on commit 296527d

Please sign in to comment.