aboutsummaryrefslogtreecommitdiffstats
path: root/src/libcharon/daemon.c
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2012-04-24 11:07:56 +0200
committerTobias Brunner <tobias@strongswan.org>2012-05-03 13:57:04 +0200
commit18758e3d2ea173b798a827917e4f8a1f9c4bc9a2 (patch)
tree3f1f4d82da19fcddc24190e4d86b55daa6491e4b /src/libcharon/daemon.c
parent37d9334366759e0183f84b01d3a7d2a4c154e995 (diff)
downloadstrongswan-18758e3d2ea173b798a827917e4f8a1f9c4bc9a2.tar.bz2
strongswan-18758e3d2ea173b798a827917e4f8a1f9c4bc9a2.tar.xz
Store the name of the binary using libcharon to enable specific settings.
Diffstat (limited to 'src/libcharon/daemon.c')
-rw-r--r--src/libcharon/daemon.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libcharon/daemon.c b/src/libcharon/daemon.c
index c6238ebab..2cf8d5e08 100644
--- a/src/libcharon/daemon.c
+++ b/src/libcharon/daemon.c
@@ -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());