mirror of
https://github.com/openvswitch/ovs
synced 2025-09-02 15:25:22 +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:
@@ -39,9 +39,9 @@ static int fd__ = 0;
|
|||||||
uint64_t
|
uint64_t
|
||||||
perf_counter_read(uint64_t *counter)
|
perf_counter_read(uint64_t *counter)
|
||||||
{
|
{
|
||||||
if (fd__ > 0) {
|
size_t size = sizeof *counter;
|
||||||
read(fd__, counter, sizeof(*counter));
|
|
||||||
} else {
|
if (fd__ <= 0 || read(fd__, counter, size) < size) {
|
||||||
*counter = 0;
|
*counter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user