Miroslav Lichvar
2014-11-05 11:22:43 UTC
Initialize all descriptors to prevent polling invalid descriptors from
faulty ports.
Signed-off-by: Miroslav Lichvar <***@redhat.com>
---
port.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/port.c b/port.c
index aae5910..6ce63f7 100644
--- a/port.c
+++ b/port.c
@@ -1401,7 +1401,7 @@ static void port_disable(struct port *p)
for (i = 0; i < N_TIMER_FDS; i++) {
close(p->fda.fd[FD_ANNOUNCE_TIMER + i]);
}
- port_clear_fda(p, N_TIMER_FDS);
+ port_clear_fda(p, FD_ANNOUNCE_TIMER + N_TIMER_FDS);
clock_fda_changed(p->clock);
}
@@ -2489,7 +2489,7 @@ struct port *port_open(int phc_index,
}
p->nrate.ratio = 1.0;
- port_clear_fda(p, N_TIMER_FDS);
+ port_clear_fda(p, FD_ANNOUNCE_TIMER + N_TIMER_FDS);
p->fault_fd = -1;
if (number) {
p->fault_fd = timerfd_create(CLOCK_MONOTONIC, 0);
faulty ports.
Signed-off-by: Miroslav Lichvar <***@redhat.com>
---
port.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/port.c b/port.c
index aae5910..6ce63f7 100644
--- a/port.c
+++ b/port.c
@@ -1401,7 +1401,7 @@ static void port_disable(struct port *p)
for (i = 0; i < N_TIMER_FDS; i++) {
close(p->fda.fd[FD_ANNOUNCE_TIMER + i]);
}
- port_clear_fda(p, N_TIMER_FDS);
+ port_clear_fda(p, FD_ANNOUNCE_TIMER + N_TIMER_FDS);
clock_fda_changed(p->clock);
}
@@ -2489,7 +2489,7 @@ struct port *port_open(int phc_index,
}
p->nrate.ratio = 1.0;
- port_clear_fda(p, N_TIMER_FDS);
+ port_clear_fda(p, FD_ANNOUNCE_TIMER + N_TIMER_FDS);
p->fault_fd = -1;
if (number) {
p->fault_fd = timerfd_create(CLOCK_MONOTONIC, 0);
--
1.9.3
------------------------------------------------------------------------------
1.9.3
------------------------------------------------------------------------------