From: Michal Sojka Date: Tue, 26 May 2009 15:01:50 +0000 (+0200) Subject: Disable discovery protocol when INET is default X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/forb.git/commitdiff_plain/585aef652964cb4906e62d99a05cf0f69e47d075 Disable discovery protocol when INET is default --- diff --git a/src/port.c b/src/port.c index f38eb87..60121b0 100644 --- a/src/port.c +++ b/src/port.c @@ -164,7 +164,9 @@ void forb_destroy_port(forb_port_t *port) forb_syncobj_signal(&port->hello); pthread_join(port->receiver_thread.pthread_id, &thread_return); +#ifndef CONFIG_FORB_PROTO_INET_DEFAULT pthread_join(port->discovery_thread.pthread_id, &thread_return); +#endif if (port->desc.proto->port_destroy) { port->desc.proto->port_destroy(port); diff --git a/src/proto_inet.c b/src/proto_inet.c index c7874c3..8442dfc 100644 --- a/src/proto_inet.c +++ b/src/proto_inet.c @@ -58,6 +58,7 @@ #include #include #include +#include /** * @file proto_inet.c @@ -560,13 +561,15 @@ forb_inet_port_init(struct forb_port_desc *port_desc, struct in_addr listen_on, port_priv->listen_socket, &ev); if (ret) goto err_close_epoll; - + +#ifndef CONFIG_FORB_PROTO_INET_DEFAULT ev.events = EPOLLIN | EPOLLET; ev.data.fd = port_priv->udp_socket; ret = epoll_ctl(port_priv->epoll_fd, EPOLL_CTL_ADD, port_priv->udp_socket, &ev); if (ret) goto err_close_epoll; +#endif port_desc->proto = &proto_inet; port_desc->proto_priv = port_priv;