]> git.meshlink.io Git - meshlink/blobdiff - test/channels-fork.c
Fix assert that could incorrectly be triggered when a peer closed the channel.
[meshlink] / test / channels-fork.c
index 9168168c8db54ab237d0ed0c992c582e7e2cee24..30f7cf8ecb35b61d2c3e6cca9b54d945b4d40fb0 100644 (file)
@@ -96,7 +96,7 @@ static int main1(int rfd, int wfd) {
 
        meshlink_enable_discovery(mesh, false);
 
-       assert(meshlink_add_address(mesh, "localhost"));
+       assert(meshlink_set_canonical_address(mesh, meshlink_get_self(mesh), "localhost", NULL));
 
        char *data = meshlink_export(mesh);
        assert(data);
@@ -152,7 +152,7 @@ static int main2(int rfd, int wfd) {
 
        meshlink_enable_discovery(mesh, false);
 
-       assert(meshlink_add_address(mesh, "localhost"));
+       assert(meshlink_set_canonical_address(mesh, meshlink_get_self(mesh), "localhost", NULL));
 
        char *data = meshlink_export(mesh);
        assert(data);
@@ -186,7 +186,7 @@ static void alarm_handler(int sig) {
        assert(0);
 }
 
-int main() {
+int main(void) {
        int fda[2], fdb[2];
 
        assert(pipe2(fda, 0) != -1);