projects
/
cascardo
/
ovs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
296527d
)
perf-counter: use 'int' instead of size_t
author
Andy Zhou
<azhou@nicira.com>
Wed, 15 Apr 2015 00:25:32 +0000
(17:25 -0700)
committer
Andy Zhou
<azhou@nicira.com>
Wed, 15 Apr 2015 00:25:43 +0000
(17:25 -0700)
'size_t' does not allow for catching the case where 'read' returns
an error code, which is a negative number.
Reported-by: Ben Pfaff <blp@nicira.com>
Signed-off-by: Andy Zhou <azhou@nicira.com>
lib/perf-counter.c
patch
|
blob
|
history
diff --git
a/lib/perf-counter.c
b/lib/perf-counter.c
index
b700e49
..
4188f6b
100644
(file)
--- a/
lib/perf-counter.c
+++ b/
lib/perf-counter.c
@@
-39,7
+39,7
@@
static int fd__ = 0;
uint64_t
perf_counter_read(uint64_t *counter)
{
-
size_
t size = sizeof *counter;
+
in
t size = sizeof *counter;
if (fd__ <= 0 || read(fd__, counter, size) < size) {
*counter = 0;