Properly use the timeout_initialized() macro.
This commit is contained in:
parent
bf6490825e
commit
531d5a904a
2 changed files with 2 additions and 2 deletions
|
@ -376,7 +376,7 @@ void graph(void)
|
||||||
sssp_bfs();
|
sssp_bfs();
|
||||||
mst_kruskal();
|
mst_kruskal();
|
||||||
|
|
||||||
if(!ev.ev_callback)
|
if(!timeout_initialized(&ev))
|
||||||
timeout_set(&ev, dump_graph, NULL);
|
timeout_set(&ev, dump_graph, NULL);
|
||||||
event_add(&ev, &(struct timeval){5, 0});
|
event_add(&ev, &(struct timeval){5, 0});
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ static void send_mtu_probe_handler(int fd, short events, void *data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void send_mtu_probe(node_t *n) {
|
void send_mtu_probe(node_t *n) {
|
||||||
if(!n->mtuevent.ev_callback)
|
if(!timeout_initialized(&n->mtuevent))
|
||||||
timeout_set(&n->mtuevent, send_mtu_probe_handler, n);
|
timeout_set(&n->mtuevent, send_mtu_probe_handler, n);
|
||||||
send_mtu_probe_handler(0, 0, n);
|
send_mtu_probe_handler(0, 0, n);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue