Remove a useless variable from the file descriptor array data type.

It was a cute idea to have the raw Ethernet layer use just one socket,
but it ended up not working on some specific PTP time stamping hardware.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2012-03-21 13:55:56 +01:00
parent 39b10a5a16
commit 0ca8143da5
5 changed files with 2 additions and 6 deletions

View File

@ -275,7 +275,7 @@ void clock_install_fda(struct clock *c, struct port *p, struct fdarray fda)
if (p == c->port[i])
break;
}
for (j = 0; j < fda.cnt; j++) {
for (j = 0; j < N_POLLFD; j++) {
k = N_POLLFD * i + j;
c->pollfd[k].fd = fda.fd[j];
c->pollfd[k].events = POLLIN|POLLPRI;
@ -375,7 +375,7 @@ void clock_remove_fda(struct clock *c, struct port *p, struct fdarray fda)
if (p == c->port[i])
break;
}
for (j = 0; j < fda.cnt; j++) {
for (j = 0; j < N_POLLFD; j++) {
k = N_POLLFD * i + j;
c->pollfd[k].fd = -1;
c->pollfd[k].events = 0;

1
fd.h
View File

@ -35,7 +35,6 @@ enum {
struct fdarray {
int fd[N_POLLFD];
int cnt;
};
#endif

1
port.c
View File

@ -546,7 +546,6 @@ static int port_initialize(struct port *p)
for (i = 0; i < N_TIMER_FDS; i++) {
p->fda.fd[FD_ANNOUNCE_TIMER + i] = fd[i];
p->fda.cnt++;
}
if (port_set_announce_tmo(p))

1
raw.c
View File

@ -190,7 +190,6 @@ static int raw_open(struct transport *t, char *name,
fda->fd[FD_EVENT] = efd;
fda->fd[FD_GENERAL] = gfd;
fda->cnt = 2;
return 0;
no_timestamping:

1
udp.c
View File

@ -149,7 +149,6 @@ static int udp_open(struct transport *t, char *name, struct fdarray *fda,
fda->fd[FD_EVENT] = efd;
fda->fd[FD_GENERAL] = gfd;
fda->cnt = 2;
return 0;
no_timestamping: