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 f3ba4c6..619c258 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 (now.tv_sec - allsent.tv_sec >= 2)
+                       timespec_subtract(&diff, &now, &allsent);
+                       if (diff.tv_sec >= 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)
-               printf("lost=%d\n", stats.enobufs);
+               printf("lost=%d\n", stats.lost);
 
        return 0;
 }