mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
keep reference to orginial config uri
This commit is contained in:
parent
9d7d9badfc
commit
0c98a01820
2 changed files with 7 additions and 0 deletions
|
@ -56,6 +56,8 @@ struct super_node {
|
|||
} cli;
|
||||
|
||||
enum state state;
|
||||
|
||||
char *uri; /**< URI of configuration */
|
||||
|
||||
config_t cfg; /**< Pointer to configuration file */
|
||||
json_t *json; /**< JSON representation of the same config. */
|
||||
|
|
|
@ -176,6 +176,8 @@ int super_node_parse_uri(struct super_node *sn, const char *uri)
|
|||
afclose(af);
|
||||
else if (f != stdin)
|
||||
fclose(f);
|
||||
|
||||
sn->uri = strdup(uri);
|
||||
|
||||
return super_node_parse(sn, cfg_root);
|
||||
}
|
||||
|
@ -459,6 +461,9 @@ int super_node_destroy(struct super_node *sn)
|
|||
log_destroy(&sn->log);
|
||||
|
||||
config_destroy(&sn->cfg);
|
||||
|
||||
if (sn->uri)
|
||||
free(sn->uri);
|
||||
|
||||
sn->state = STATE_DESTROYED;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue