diff options
Diffstat (limited to 'sbin/hastd/control.c')
-rw-r--r-- | sbin/hastd/control.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/sbin/hastd/control.c b/sbin/hastd/control.c index eab7a9e..87fa42a 100644 --- a/sbin/hastd/control.c +++ b/sbin/hastd/control.c @@ -411,7 +411,6 @@ ctrl_thread(void *arg) nv_free(nvin); continue; } - nv_free(nvin); nvout = nv_alloc(); switch (cmd) { case HASTCTL_STATUS: @@ -433,11 +432,23 @@ ctrl_thread(void *arg) nv_add_uint32(nvout, (uint32_t)0, "keepdirty"); nv_add_uint64(nvout, (uint64_t)0, "dirty"); } + nv_add_int16(nvout, 0, "error"); + break; + case HASTCTL_RELOAD: + /* + * When parent receives SIGHUP and discovers that + * something related to us has changes, it sends reload + * message to us. + */ + assert(res->hr_role == HAST_ROLE_PRIMARY); + primary_config_reload(res, nvin); + nv_add_int16(nvout, 0, "error"); break; default: nv_add_int16(nvout, EINVAL, "error"); break; } + nv_free(nvin); if (nv_error(nvout) != 0) { pjdlog_error("Unable to create answer on control message."); nv_free(nvout); |