ovs-benchmark: improve 'rate' command piped output support.
[sliver-openvswitch.git] / utilities / ovs-benchmark.c
index 162f7cf..8bea9f0 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2011, 2012 Nicira, Inc.
+ * Copyright (c) 2010, 2011, 2012, 2013 Nicira, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -472,6 +472,7 @@ cmd_rate(int argc OVS_UNUSED, char *argv[] OVS_UNUSED)
             printf("%.3f s elapsed, %u OK, %u failed, avg %.1f/s\n",
                    elapsed / 1000.0, completed - failures, failures,
                    completed / (elapsed / 1000.0));
+            fflush(stdout);
             prev = now;
 
             if (timeout && elapsed > timeout * 1000LL) {