mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
smaller cleanups
This commit is contained in:
parent
794e4dee36
commit
e927795388
5 changed files with 12 additions and 6 deletions
|
@ -59,6 +59,8 @@ static int stats_send_parse(struct hook *h, config_setting_t *cfg)
|
|||
const char *dest, *mode;
|
||||
|
||||
if (config_setting_lookup_string(cfg, "destination", &dest)) {
|
||||
assert(h->path);
|
||||
|
||||
p->dest = list_lookup(&h->path->super_node->nodes, dest);
|
||||
if (!p->dest)
|
||||
cerror(cfg, "Invalid destination node '%s' for hook '%s'", dest, plugin_name(h->_vt));
|
||||
|
|
|
@ -249,8 +249,6 @@ int super_node_parse(struct super_node *sn, config_setting_t *cfg)
|
|||
|
||||
struct node *n = alloc(sizeof(struct node));
|
||||
|
||||
n->state = STATE_DESTROYED;
|
||||
|
||||
ret = node_init(n, &p->node);
|
||||
if (ret)
|
||||
cerror(cfg_node, "Failed to initialize node");
|
||||
|
|
|
@ -153,6 +153,7 @@ int main(int argc, char *argv[])
|
|||
|
||||
config_init(&cfg);
|
||||
|
||||
/** @todo villas-hook does not use the path structure */
|
||||
ret = hook_init(&h, &p->hook, NULL);
|
||||
if (ret)
|
||||
error("Failed to initialize hook");
|
||||
|
|
12
src/node.c
12
src/node.c
|
@ -47,14 +47,20 @@ struct super_node sn;
|
|||
|
||||
static void quit(int signal, siginfo_t *sinfo, void *ctx)
|
||||
{
|
||||
int ret;
|
||||
|
||||
if (sn.stats > 0)
|
||||
stats_print_footer(STATS_FORMAT_HUMAN);
|
||||
|
||||
super_node_stop(&sn);
|
||||
super_node_destroy(&sn);
|
||||
ret = super_node_stop(&sn);
|
||||
if (ret)
|
||||
error("Failed to stop super node");
|
||||
|
||||
ret = super_node_destroy(&sn);
|
||||
if (ret)
|
||||
error("Failed to destroy super node");
|
||||
|
||||
info(CLR_GRN("Goodbye!"));
|
||||
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
|
|
@ -192,7 +192,6 @@ static void * recv_loop(void *ctx)
|
|||
|
||||
leave: info("Reached receive limit. Terminating...");
|
||||
killme(SIGTERM);
|
||||
return NULL;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue