Store the name of the daemon that initialized libhydra to load daemon-specific settings.

This commit is contained in:
Tobias Brunner
2010-04-06 12:47:40 +02:00
parent e82b5755be
commit facf887253
4 changed files with 14 additions and 4 deletions
+3 -1
View File
@@ -42,6 +42,7 @@ void libhydra_deinit()
{
private_hydra_t *this = (private_hydra_t*)hydra;
this->public.attributes->destroy(this->public.attributes);
free((void*)this->public.daemon);
free(this);
hydra = NULL;
}
@@ -49,13 +50,14 @@ void libhydra_deinit()
/**
* Described in header.
*/
bool libhydra_init()
bool libhydra_init(const char *daemon)
{
private_hydra_t *this;
INIT(this,
.public = {
.attributes = attribute_manager_create(),
.daemon = strdup(daemon ?: "libhydra"),
},
);
hydra = &this->public;