libhydra: Remove unused hydra->daemon
authorTobias Brunner <tobias@strongswan.org>
Wed, 22 Jan 2014 13:39:41 +0000 (14:39 +0100)
committerTobias Brunner <tobias@strongswan.org>
Wed, 12 Feb 2014 13:34:32 +0000 (14:34 +0100)
src/charon-cmd/charon-cmd.c
src/charon-nm/charon-nm.c
src/charon-tkm/src/charon-tkm.c
src/charon-tkm/tests/tests.c
src/charon/charon.c
src/conftest/conftest.c
src/frontends/android/jni/libandroidbridge/charonservice.c
src/frontends/osx/charon-xpc/charon-xpc.c
src/libhydra/hydra.c
src/libhydra/hydra.h
src/starter/starter.c

index 13f9785..e7e0c9d 100644 (file)
@@ -334,7 +334,7 @@ int main(int argc, char *argv[])
                }
        }
        atexit(libhydra_deinit);
-       if (!libhydra_init("charon-cmd"))
+       if (!libhydra_init())
        {
                exit(SS_RC_INITIALIZATION_FAILED);
        }
index 12667ab..830d44b 100644 (file)
@@ -175,7 +175,7 @@ int main(int argc, char *argv[])
                exit(SS_RC_DAEMON_INTEGRITY);
        }
 
-       if (!libhydra_init("charon-nm"))
+       if (!libhydra_init())
        {
                dbg_syslog(DBG_DMN, 1, "initialization failed - aborting charon-nm");
                libhydra_deinit();
index 1e9fecd..1b9fc1c 100644 (file)
@@ -256,7 +256,7 @@ int main(int argc, char *argv[])
                exit(status);
        }
 
-       if (!libhydra_init(dmn_name))
+       if (!libhydra_init())
        {
                dbg_syslog(DBG_DMN, 1, "initialization failed - aborting %s", dmn_name);
                libhydra_deinit();
index 5bbacac..7a25565 100644 (file)
@@ -50,7 +50,7 @@ static bool test_runner_init(bool init)
 
        if (init)
        {
-               libhydra_init("test_runner");
+               libhydra_init();
                libcharon_init("test_runner");
                lib->settings->set_int(lib->settings,
                                                           "test_runner.filelog.stdout.default", 0);
index d799691..8a89c76 100644 (file)
@@ -303,7 +303,7 @@ int main(int argc, char *argv[])
                exit(SS_RC_DAEMON_INTEGRITY);
        }
 
-       if (!libhydra_init("charon"))
+       if (!libhydra_init())
        {
                dbg_stderr(DBG_DMN, 1, "initialization failed - aborting charon");
                libhydra_deinit();
index d935058..d26991f 100644 (file)
@@ -440,7 +440,7 @@ int main(int argc, char *argv[])
                library_deinit();
                return SS_RC_LIBSTRONGSWAN_INTEGRITY;
        }
-       if (!libhydra_init("conftest"))
+       if (!libhydra_init())
        {
                libhydra_deinit();
                library_deinit();
index d5a68bb..b50d5ac 100644 (file)
@@ -611,7 +611,7 @@ JNI_METHOD(CharonVpnService, initializeCharon, jboolean,
        set_options(logfile);
        free(logfile);
 
-       if (!libhydra_init("charon"))
+       if (!libhydra_init())
        {
                libhydra_deinit();
                library_deinit();
index 74ad214..4b7cd3a 100644 (file)
@@ -145,7 +145,7 @@ int main(int argc, char *argv[])
                }
        }
        atexit(libhydra_deinit);
-       if (!libhydra_init("charon-xpc"))
+       if (!libhydra_init())
        {
                exit(SS_RC_INITIALIZATION_FAILED);
        }
index f531bd5..1b50650 100644 (file)
@@ -59,7 +59,6 @@ void libhydra_deinit()
 
        this->public.attributes->destroy(this->public.attributes);
        this->public.kernel_interface->destroy(this->public.kernel_interface);
-       free((void*)this->public.daemon);
        free(this);
        hydra = NULL;
 }
@@ -67,7 +66,7 @@ void libhydra_deinit()
 /**
  * Described in header.
  */
-bool libhydra_init(const char *daemon)
+bool libhydra_init()
 {
        private_hydra_t *this;
 
@@ -81,7 +80,6 @@ bool libhydra_init(const char *daemon)
        INIT(this,
                .public = {
                        .attributes = attribute_manager_create(),
-                       .daemon = strdup(daemon ?: "libhydra"),
                },
                .ref = 1,
        );
index 2a8709d..94209ff 100644 (file)
@@ -53,11 +53,6 @@ struct hydra_t {
         * kernel interface to communicate with kernel
         */
        kernel_interface_t *kernel_interface;
-
-       /**
-        * name of the daemon that initialized the library
-        */
-       const char *daemon;
 };
 
 /**
@@ -70,15 +65,12 @@ extern hydra_t *hydra;
 /**
  * Initialize libhydra.
  *
- * The daemon's name is used to load daemon-specific settings.
- *
  * libhydra_init() may be called multiple times in a single process, but each
- * caller should call libhydra_deinit() for each call to libhydra_init().
+ * caller must call libhydra_deinit() for each call to libhydra_init().
  *
- * @param daemon               name of the daemon that initializes the library
  * @return                             FALSE if integrity check failed
  */
-bool libhydra_init(const char *daemon);
+bool libhydra_init();
 
 /**
  * Deinitialize libhydra.
index 87ad66d..33916c9 100644 (file)
@@ -422,7 +422,7 @@ int main (int argc, char **argv)
        library_init(NULL, "starter");
        atexit(library_deinit);
 
-       libhydra_init("starter");
+       libhydra_init();
        atexit(libhydra_deinit);
 
        /* parse command line */