diff --git a/dist/tools/zep_dispatch/main.c b/dist/tools/zep_dispatch/main.c index 6efac625e5..3dcc62f54d 100644 --- a/dist/tools/zep_dispatch/main.c +++ b/dist/tools/zep_dispatch/main.c @@ -105,7 +105,7 @@ static void dispatch_loop(int sock, dispatch_cb_t dispatch, void *ctx) } static topology_t topology; -static const char *graphviz_file; +static const char *graphviz_file = "example.gv"; static void _info_handler(int signal) { if (signal != SIGUSR1) { diff --git a/dist/tools/zep_dispatch/topology.c b/dist/tools/zep_dispatch/topology.c index 1744ba0229..173f1fdb63 100644 --- a/dist/tools/zep_dispatch/topology.c +++ b/dist/tools/zep_dispatch/topology.c @@ -151,10 +151,14 @@ int topology_print(const char *file, const topology_t *t) for (list_node_t *edge = t->edges.next; edge; edge = edge->next) { struct edge *super = container_of(edge, struct edge, next); - fprintf(out, "\t%s -> %s [ label = \"%.2f\" ]\n", - super->a->name, super->b->name, super->weight_a_b); - fprintf(out, "\t%s -> %s [ label = \"%.2f\" ]\n", - super->b->name, super->a->name, super->weight_b_a); + if (super->weight_a_b) { + fprintf(out, "\t%s -> %s [ label = \"%.2f\" ]\n", + super->a->name, super->b->name, super->weight_a_b); + } + if (super->weight_b_a) { + fprintf(out, "\t%s -> %s [ label = \"%.2f\" ]\n", + super->b->name, super->a->name, super->weight_b_a); + } } fprintf(out, "}\n");