summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--wct4xxp.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/wct4xxp.c b/wct4xxp.c
index 7ce1e19..2ee6552 100644
--- a/wct4xxp.c
+++ b/wct4xxp.c
@@ -1923,14 +1923,20 @@ static void __t4_do_counters(struct t4 *wc)
int span;
for (span=0;span<wc->numspans;span++) {
struct t4_span *ts = wc->tspans[span];
+ int docheck=0;
+ if (ts->loopupcnt || ts->loopdowncnt)
+ docheck++;
if (ts->alarmtimer) {
if (!--ts->alarmtimer) {
+ docheck++;
ts->span.alarms &= ~(ZT_ALARM_RECOVER);
- if (!polling)
- __t4_check_alarms(wc, span);
- zt_alarm_notify(&ts->span);
}
}
+ if (docheck) {
+ if (!polling)
+ __t4_check_alarms(wc, span);
+ zt_alarm_notify(&ts->span);
+ }
}
}