Just a little hit
This commit is contained in:
parent
13cfe03cbe
commit
a76ea9125a
1 changed files with 10 additions and 6 deletions
16
src/if.c
16
src/if.c
|
@ -238,26 +238,24 @@ error_list_start:
|
||||||
int patty_ax25_add_if(patty_ax25 *ax25, patty_ax25_if *iface) {
|
int patty_ax25_add_if(patty_ax25 *ax25, patty_ax25_if *iface) {
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
if ((fd = patty_kiss_tnc_fd_unix(iface->tnc)) < 0) {
|
if ((fd = patty_kiss_tnc_fd_unix(iface->tnc)) >= 0) {
|
||||||
goto error_kiss_tnc_fd_unix;
|
FD_SET(fd, &ax25->unix_fds);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (patty_list_append(ax25->ifaces, iface) == NULL) {
|
if (patty_list_append(ax25->ifaces, iface) == NULL) {
|
||||||
goto error_list_append;
|
goto error_list_append;
|
||||||
}
|
}
|
||||||
|
|
||||||
FD_SET(fd, &ax25->unix_fds);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
error_list_append:
|
error_list_append:
|
||||||
error_kiss_tnc_fd_unix:
|
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
int patty_ax25_delete_if(patty_ax25 *ax25, patty_ax25_if *iface) {
|
int patty_ax25_delete_if(patty_ax25 *ax25, patty_ax25_if *iface) {
|
||||||
patty_list_item *item = ax25->ifaces->first;
|
patty_list_item *item = ax25->ifaces->first;
|
||||||
int i = 0;
|
|
||||||
|
int fd, i = 0;
|
||||||
|
|
||||||
while (item) {
|
while (item) {
|
||||||
if (item->value == iface) {
|
if (item->value == iface) {
|
||||||
|
@ -272,6 +270,12 @@ int patty_ax25_delete_if(patty_ax25 *ax25, patty_ax25_if *iface) {
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ((fd = patty_kiss_tnc_fd_unix(iface->tnc)) >= 0) {
|
||||||
|
FD_CLR(fd, &ax25->unix_fds);
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
error_list_splice:
|
error_list_splice:
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue