Store the name of the binary using libcharon to enable specific settings.

This commit is contained in:
Tobias Brunner
2012-05-03 13:57:04 +02:00
parent 37d9334366
commit 18758e3d2e
5 changed files with 14 additions and 7 deletions
+4 -3
View File
@@ -247,7 +247,7 @@ METHOD(daemon_t, initialize, bool,
/**
* Create the daemon.
*/
private_daemon_t *daemon_create()
private_daemon_t *daemon_create(const char *name)
{
private_daemon_t *this;
@@ -260,6 +260,7 @@ private_daemon_t *daemon_create()
.bus = bus_create(),
.file_loggers = linked_list_create(),
.sys_loggers = linked_list_create(),
.name = strdup(name ?: "libcharon"),
},
);
charon = &this->public;
@@ -298,9 +299,9 @@ void libcharon_deinit()
/**
* Described in header.
*/
bool libcharon_init()
bool libcharon_init(const char *name)
{
daemon_create();
daemon_create(name);
/* for uncritical pseudo random numbers */
srandom(time(NULL) + getpid());