Migrated ha plugin to INIT/METHOD macros
This commit is contained in:
@@ -96,10 +96,8 @@ static job_requeue_t dispatch_fifo(private_ha_ctl_t *this)
|
||||
return JOB_REQUEUE_DIRECT;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of ha_ctl_t.destroy.
|
||||
*/
|
||||
static void destroy(private_ha_ctl_t *this)
|
||||
METHOD(ha_ctl_t, destroy, void,
|
||||
private_ha_ctl_t *this)
|
||||
{
|
||||
this->job->cancel(this->job);
|
||||
free(this);
|
||||
@@ -110,9 +108,14 @@ static void destroy(private_ha_ctl_t *this)
|
||||
*/
|
||||
ha_ctl_t *ha_ctl_create(ha_segments_t *segments)
|
||||
{
|
||||
private_ha_ctl_t *this = malloc_thing(private_ha_ctl_t);
|
||||
private_ha_ctl_t *this;
|
||||
|
||||
this->public.destroy = (void(*)(ha_ctl_t*))destroy;
|
||||
INIT(this,
|
||||
.public = {
|
||||
.destroy = _destroy,
|
||||
},
|
||||
.segments = segments,
|
||||
);
|
||||
|
||||
if (access(HA_FIFO, R_OK|W_OK) != 0)
|
||||
{
|
||||
@@ -123,7 +126,6 @@ ha_ctl_t *ha_ctl_create(ha_segments_t *segments)
|
||||
}
|
||||
}
|
||||
|
||||
this->segments = segments;
|
||||
this->job = callback_job_create((callback_job_cb_t)dispatch_fifo,
|
||||
this, NULL, NULL);
|
||||
charon->processor->queue_job(charon->processor, (job_t*)this->job);
|
||||
|
||||
Reference in New Issue
Block a user