mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-22 21:41:04 +01:00
Rename HASTCTL_ defines, which are used for conversion between main
hastd process and workers, remove unused one and set different range of numbers. This is done in order not to confuse them with HASTCTL_CMD defines, used for conversation between hastctl and hastd, and to avoid bugs like the one fixed in in r221075. Approved by: pjd (mentor) MFC after: 1 week
This commit is contained in:
parent
1768fba5c0
commit
7a2b83683d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=221076
@ -162,7 +162,7 @@ control_status_worker(struct hast_resource *res, struct nv *nvout,
|
||||
* Prepare and send command to worker process.
|
||||
*/
|
||||
cnvout = nv_alloc();
|
||||
nv_add_uint8(cnvout, HASTCTL_STATUS, "cmd");
|
||||
nv_add_uint8(cnvout, CONTROL_STATUS, "cmd");
|
||||
error = nv_error(cnvout);
|
||||
if (error != 0) {
|
||||
pjdlog_common(LOG_ERR, 0, error,
|
||||
@ -427,7 +427,7 @@ ctrl_thread(void *arg)
|
||||
}
|
||||
nvout = nv_alloc();
|
||||
switch (cmd) {
|
||||
case HASTCTL_STATUS:
|
||||
case CONTROL_STATUS:
|
||||
if (res->hr_remotein != NULL &&
|
||||
res->hr_remoteout != NULL) {
|
||||
nv_add_string(nvout, "complete", "status");
|
||||
@ -448,7 +448,7 @@ ctrl_thread(void *arg)
|
||||
}
|
||||
nv_add_int16(nvout, 0, "error");
|
||||
break;
|
||||
case HASTCTL_RELOAD:
|
||||
case CONTROL_RELOAD:
|
||||
/*
|
||||
* When parent receives SIGHUP and discovers that
|
||||
* something related to us has changes, it sends reload
|
||||
|
@ -32,9 +32,8 @@
|
||||
#ifndef _CONTROL_H_
|
||||
#define _CONTROL_H_
|
||||
|
||||
#define HASTCTL_SET_ROLE 1
|
||||
#define HASTCTL_STATUS 2
|
||||
#define HASTCTL_RELOAD 3
|
||||
#define CONTROL_STATUS 10
|
||||
#define CONTROL_RELOAD 11
|
||||
|
||||
struct hastd_config;
|
||||
struct hast_resource;
|
||||
|
@ -424,7 +424,7 @@ resource_reload(const struct hast_resource *res)
|
||||
PJDLOG_ASSERT(res->hr_role == HAST_ROLE_PRIMARY);
|
||||
|
||||
nvout = nv_alloc();
|
||||
nv_add_uint8(nvout, HASTCTL_RELOAD, "cmd");
|
||||
nv_add_uint8(nvout, CONTROL_RELOAD, "cmd");
|
||||
nv_add_string(nvout, res->hr_remoteaddr, "remoteaddr");
|
||||
nv_add_string(nvout, res->hr_sourceaddr, "sourceaddr");
|
||||
nv_add_int32(nvout, (int32_t)res->hr_replication, "replication");
|
||||
|
Loading…
Reference in New Issue
Block a user