]> rtime.felk.cvut.cz Git - can-benchmark.git/commitdiff
Fix shown number of lost messages and finish at most one second after the last messag...
authorMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 4 Dec 2010 15:37:06 +0000 (16:37 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Sat, 4 Dec 2010 15:37:06 +0000 (16:37 +0100)
latester/latester.c

index f3ba4c60414b98ec7f3f0cc74ee8a2309b71d59c..619c2582838a59a86959dd035b16485c4597d383 100644 (file)
@@ -748,7 +748,8 @@ int main(int argc, const char *argv[])
                if (opt.count != 0 && count >= opt.count) {
                        if (allsent.tv_sec == 0)
                                allsent = now;
                if (opt.count != 0 && count >= opt.count) {
                        if (allsent.tv_sec == 0)
                                allsent = now;
-                       if (now.tv_sec - allsent.tv_sec >= 2)
+                       timespec_subtract(&diff, &now, &allsent);
+                       if (diff.tv_sec >= 1)
                                finish_flag = 1;
                }
        }
                                finish_flag = 1;
                }
        }
@@ -774,7 +775,7 @@ int main(int argc, const char *argv[])
        if (stats.enobufs)
                printf("enobufs=%d\n", stats.enobufs);
        if (stats.lost)
        if (stats.enobufs)
                printf("enobufs=%d\n", stats.enobufs);
        if (stats.lost)
-               printf("lost=%d\n", stats.enobufs);
+               printf("lost=%d\n", stats.lost);
 
        return 0;
 }
 
        return 0;
 }