summaryrefslogtreecommitdiff
path: root/src/run.c
diff options
context:
space:
mode:
author/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2008-01-09 23:15:31 +0000
committer/C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org </C=EU/ST=EU/CN=Pablo Neira Ayuso/emailAddress=pablo@netfilter.org>2008-01-09 23:15:31 +0000
commit3370112cc3c9f0446fbe7375bdb32831872814f4 (patch)
treea5a6b2aa2e8146407b01ae844529692aede2c32d /src/run.c
parent920b90f2b03c60b6940e83cdce8c4b4bfbbc4268 (diff)
downloadconntrack-tools-3370112cc3c9f0446fbe7375bdb32831872814f4.tar.gz
conntrack-tools-3370112cc3c9f0446fbe7375bdb32831872814f4.zip
fix statistics mode CPU sucks up (broken with 7178)
Diffstat (limited to 'src/run.c')
-rw-r--r--src/run.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/run.c b/src/run.c
index 3dc8ecc..7d166bb 100644
--- a/src/run.c
+++ b/src/run.c
@@ -227,11 +227,15 @@ void run(void)
.tv_sec = 1,
.tv_usec = 0
};
+ struct timeval *next = &next_alarm;
+
+ if (CONFIG(flags) & CTD_STATS_MODE)
+ next = NULL;
while(1) {
- if (__run(&next_alarm)) {
+ if (__run(next)) {
sigprocmask(SIG_BLOCK, &STATE(block), NULL);
- do_alarm_run(&next_alarm);
+ do_alarm_run(next);
sigprocmask(SIG_UNBLOCK, &STATE(block), NULL);
}
}