libhydra: Remove unused hydra->daemon
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
+1
-1
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
);
|
||||
|
||||
+2
-10
@@ -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.
|
||||
|
||||
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user