Kill fields buf, loaded and output_error of struct receiver node.
[paraslash.git] / recv.c
diff --git a/recv.c b/recv.c
index e04f6484981a9659fe399d9df4066c06ca6dab2b..05f616cd021202a0a373a0bb763b77ce4c98d21d 100644 (file)
--- a/recv.c
+++ b/recv.c
@@ -92,16 +92,14 @@ int main(int argc, char *argv[])
        }
        r = &receivers[receiver_num];
        rn.receiver = r;
-       rn.btr_root = btr_new_node("receiver", NULL /* no parent */);
+       rn.btrn = btr_new_node("receiver", NULL, NULL, NULL);
        ret = r->open(&rn);
        if (ret < 0)
                goto out;
        r_opened = 1;
 
+       sot.btrn = btr_new_node("stdout", rn.btrn, NULL, NULL);
        stdout_set_defaults(&sot);
-       sot.bufp = &rn.buf;
-       sot.loaded = &rn.loaded;
-       sot.input_error = &rn.task.error;
        register_task(&sot.task);
 
        rn.task.pre_select = r->pre_select;
@@ -111,12 +109,11 @@ int main(int argc, char *argv[])
 
        ret = schedule(&s);
 out:
-       if (r_opened) {
-               btr_del_node(rn.btr_root);
+       if (r_opened)
                r->close(&rn);
-       }
-       if (r)
-               r->shutdown();
+       btr_free_node(rn.btrn);
+       btr_free_node(sot.btrn);
+       free(rn.conf);
        if (ret < 0)
                PARA_ERROR_LOG("%s\n", para_strerror(-ret));
        return ret < 0? EXIT_FAILURE : EXIT_SUCCESS;