summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2011-01-26 12:20:38 +0100
committerRainer Gerhards <rgerhards@adiscon.com>2011-01-26 12:20:38 +0100
commit0e4373a6329a1f74dda8eceed5fd18ce92fe0d10 (patch)
treeeb5ecfbf25e73d089f17e661daf996fd2d9f2704
parent093ad4a47b1494934208f395e8c5dd116e1ae5a6 (diff)
downloadrsyslog-0e4373a6329a1f74dda8eceed5fd18ce92fe0d10.tar.gz
rsyslog-0e4373a6329a1f74dda8eceed5fd18ce92fe0d10.tar.xz
rsyslog-0e4373a6329a1f74dda8eceed5fd18ce92fe0d10.zip
tcpflood: time display was invalid due to wrong format
there was a systematic error in that decimals were 1/10th to small. No problem if you knew that, but otherwise a biggie... This is a bug in a recently introduced non-released feature.
-rw-r--r--tcpsrv.c2
-rw-r--r--tests/tcpflood.c14
2 files changed, 9 insertions, 7 deletions
diff --git a/tcpsrv.c b/tcpsrv.c
index 3a2cf81d..1ebfd91e 100644
--- a/tcpsrv.c
+++ b/tcpsrv.c
@@ -690,6 +690,8 @@ Run(tcpsrv_t *pThis)
dbgprintf("poll returned with %d entries.\n", numEntries);
for(i = 0 ; i < numEntries ; i++) {
+ if(glbl.GetGlobalInputTermState() == 1)
+ ABORT_FINALIZE(RS_RET_FORCE_TERM);
currIdx = retIDs[i];
dbgprintf("tcpsrv processing i %d, pUsr %p\n", currIdx, pUsr[i]);
if(pUsr[i] == pThis->ppLstn) {
diff --git a/tests/tcpflood.c b/tests/tcpflood.c
index 2b43ede0..7b376bdd 100644
--- a/tests/tcpflood.c
+++ b/tests/tcpflood.c
@@ -567,9 +567,9 @@ endTiming(struct timeval *tvStart, struct runstats *stats)
if(!bSilent || bStatsRecords) {
if(bCSVoutput) {
- printf("%ld.%4.4ld\n", runtime / 1000, runtime % 1000);
+ printf("%ld.%3.3ld\n", runtime / 1000, runtime % 1000);
} else {
- printf("runtime: %ld.%4.4ld\n", runtime / 1000, runtime % 1000);
+ printf("runtime: %ld.%3.3ld\n", runtime / 1000, runtime % 1000);
}
}
}
@@ -585,7 +585,7 @@ genStats(struct runstats *stats)
if(bCSVoutput) {
printf("#numRuns,TotalRuntime,AvgRuntime,MinRuntime,MaxRuntime\n");
- printf("%d,%llu.%4.4d,%lu.%4.4lu,%lu.%4.4lu,%lu.%4.4lu\n",
+ printf("%d,%llu.%3.3d,%lu.%3.3lu,%lu.%3.3lu,%lu.%3.3lu\n",
stats->numRuns,
stats->totalRuntime / 1000, (int) stats->totalRuntime % 1000,
avg / 1000, avg % 1000,
@@ -594,11 +594,11 @@ genStats(struct runstats *stats)
} else {
printf("Runs: %d\n", stats->numRuns);
printf("Runtime:\n");
- printf(" total: %llu.%4.4d\n", stats->totalRuntime / 1000,
+ printf(" total: %llu.%3.3d\n", stats->totalRuntime / 1000,
(int) stats->totalRuntime % 1000);
- printf(" avg: %lu.%4.4lu\n", avg / 1000, avg % 1000);
- printf(" min: %lu.%4.4lu\n", stats->minRuntime / 1000, stats->minRuntime % 1000);
- printf(" max: %lu.%4.4lu\n", stats->maxRuntime / 1000, stats->maxRuntime % 1000);
+ printf(" avg: %lu.%3.3lu\n", avg / 1000, avg % 1000);
+ printf(" min: %lu.%3.3lu\n", stats->minRuntime / 1000, stats->minRuntime % 1000);
+ printf(" max: %lu.%3.3lu\n", stats->maxRuntime / 1000, stats->maxRuntime % 1000);
printf("All times are wallclock time.\n");
}
}