diff mbox

[ovs-dev] ovs-benchmark: fix return value of do_poll

Message ID 1453400183-43754-1-git-send-email-u9012063@gmail.com
State Accepted
Headers show

Commit Message

William Tu Jan. 21, 2016, 6:16 p.m. UTC
A positive number is returned when do_poll successes.

Signed-off-by: William Tu <u9012063@gmail.com>
---
 utilities/ovs-benchmark.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Ben Pfaff Feb. 5, 2016, 11:57 p.m. UTC | #1
On Thu, Jan 21, 2016 at 10:16:23AM -0800, William Tu wrote:
> A positive number is returned when do_poll successes.
> 
> Signed-off-by: William Tu <u9012063@gmail.com>

Thanks, I applied this.

I think that this is a good sign that ovs-benchmark never gets used,
though.  I'm going to send out a patch that removes it.
diff mbox

Patch

diff --git a/utilities/ovs-benchmark.c b/utilities/ovs-benchmark.c
index cfff413..ee593ff 100644
--- a/utilities/ovs-benchmark.c
+++ b/utilities/ovs-benchmark.c
@@ -399,7 +399,7 @@  cmd_rate(struct ovs_cmdl_context *ctx OVS_UNUSED)
         long long int now;
         long long int may_open;
         int delay;
-        int error;
+        int retval;
         int j;
 
         if (max_rate > 0) {
@@ -458,8 +458,8 @@  cmd_rate(struct ovs_cmdl_context *ctx OVS_UNUSED)
             delay = 1000;
         }
 
-        error = do_poll(fds, n_fds, delay);
-        if (error) {
+        retval = do_poll(fds, n_fds, delay);
+        if (retval < 0) {
             ovs_fatal(errno, "poll");
         }
 
@@ -588,10 +588,10 @@  cmd_latency(struct ovs_cmdl_context *ctx OVS_UNUSED)
         }
 
         while (n_fds > 0) {
-            int error;
+            int retval;
 
-            error = do_poll(fds, n_fds, -1);
-            if (error) {
+            retval = do_poll(fds, n_fds, -1);
+            if (retval < 0) {
                 ovs_fatal(errno, "poll");
             }