2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

perf-counter: fix compiler warnings

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 <azhou@nicira.com>
Acked-by: Russell Bryant <rbryant@redhat.com>
This commit is contained in:
Andy Zhou
2015-04-14 14:22:08 -07:00
parent 60ceeb6c16
commit 296527dffb

View File

@@ -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;
}