]> git.meshlink.io Git - meshlink/commitdiff
Ensure we compile discovery.c unconditionally.
authorGuus Sliepen <guus@meshlink.io>
Sun, 12 Jul 2020 19:36:12 +0000 (21:36 +0200)
committerGuus Sliepen <guus@meshlink.io>
Thu, 15 Apr 2021 18:30:51 +0000 (20:30 +0200)
src/Makefile.am
src/meshlink.c

index 640cf64f20e900599eb422b7012b6f93b07d8f41..b5beee15f523f0a6809ac0b750881ec8dfcbdd4c 100644 (file)
@@ -42,6 +42,7 @@ libmeshlink_la_SOURCES = \
        conf.c conf.h \
        connection.c connection.h \
        crypto.c crypto.h \
+       discovery.c discovery.h \
        dropin.c dropin.h \
        ecdh.h \
        ecdsa.h \
index aa29ce8984bac86c3cbc92955793d4c6837953c6..d9bd0146e94cedaf4b6dc5967e28f6a4f00483c9 100644 (file)
@@ -1693,14 +1693,10 @@ static void *meshlink_main_loop(void *arg) {
 #endif // HAVE_SETNS
        }
 
-#if HAVE_CATTA
-
        if(mesh->discovery) {
                discovery_start(mesh);
        }
 
-#endif
-
        if(pthread_mutex_lock(&mesh->mutex) != 0) {
                abort();
        }
@@ -1712,15 +1708,11 @@ static void *meshlink_main_loop(void *arg) {
 
        pthread_mutex_unlock(&mesh->mutex);
 
-#if HAVE_CATTA
-
        // Stop discovery
        if(mesh->discovery) {
                discovery_stop(mesh);
        }
 
-#endif
-
        return NULL;
 }
 
@@ -4554,8 +4546,6 @@ void handle_duplicate_node(meshlink_handle_t *mesh, node_t *n) {
 }
 
 void meshlink_enable_discovery(meshlink_handle_t *mesh, bool enable) {
-#if HAVE_CATTA
-
        if(!mesh) {
                meshlink_errno = MESHLINK_EINVAL;
                return;
@@ -4581,11 +4571,6 @@ void meshlink_enable_discovery(meshlink_handle_t *mesh, bool enable) {
 
 end:
        pthread_mutex_unlock(&mesh->mutex);
-#else
-       (void)mesh;
-       (void)enable;
-       meshlink_errno = MESHLINK_ENOTSUP;
-#endif
 }
 
 void meshlink_set_dev_class_timeouts(meshlink_handle_t *mesh, dev_class_t devclass, int pinginterval, int pingtimeout) {