Richard Cochran
2013-02-01 04:22:43 UTC
From: Delio Brignoli <***@audioscience.com>
Arm the fault-clearing timer only when an event causes a port to change state
to PS_FAULTY. Previously, if poll() returned because of an fd event other than
the fault-clearing timeout, the fault clearing timer would re-arm for
each port in PS_FAULTY state.
Signed-off-by: Delio Brignoli <***@audioscience.com>
---
clock.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/clock.c b/clock.c
index b0a4de6..5d5ccbf 100644
--- a/clock.c
+++ b/clock.c
@@ -719,6 +719,10 @@ int clock_poll(struct clock *c)
if (EV_ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES == event)
lost = 1;
port_dispatch(c->port[i], event, 0);
+ /* Clear any fault after a little while. */
+ if (PS_FAULTY == port_state(c->port[i])) {
+ clock_fault_timeout(c, i, 1);
+ }
}
}
@@ -728,11 +732,6 @@ int clock_poll(struct clock *c)
clock_fault_timeout(c, i, 0);
port_dispatch(c->port[i], EV_FAULT_CLEARED, 0);
}
-
- /* Clear any fault after a little while. */
- if (PS_FAULTY == port_state(c->port[i])) {
- clock_fault_timeout(c, i, 1);
- }
}
/* Check the UDS port. */
Arm the fault-clearing timer only when an event causes a port to change state
to PS_FAULTY. Previously, if poll() returned because of an fd event other than
the fault-clearing timeout, the fault clearing timer would re-arm for
each port in PS_FAULTY state.
Signed-off-by: Delio Brignoli <***@audioscience.com>
---
clock.c | 9 ++++-----
1 files changed, 4 insertions(+), 5 deletions(-)
diff --git a/clock.c b/clock.c
index b0a4de6..5d5ccbf 100644
--- a/clock.c
+++ b/clock.c
@@ -719,6 +719,10 @@ int clock_poll(struct clock *c)
if (EV_ANNOUNCE_RECEIPT_TIMEOUT_EXPIRES == event)
lost = 1;
port_dispatch(c->port[i], event, 0);
+ /* Clear any fault after a little while. */
+ if (PS_FAULTY == port_state(c->port[i])) {
+ clock_fault_timeout(c, i, 1);
+ }
}
}
@@ -728,11 +732,6 @@ int clock_poll(struct clock *c)
clock_fault_timeout(c, i, 0);
port_dispatch(c->port[i], EV_FAULT_CLEARED, 0);
}
-
- /* Clear any fault after a little while. */
- if (PS_FAULTY == port_state(c->port[i])) {
- clock_fault_timeout(c, i, 1);
- }
}
/* Check the UDS port. */
--
1.7.2.5
1.7.2.5