svn commit: r221076 - head/sbin/hastd
Mikolaj Golub
trociny at FreeBSD.org
Tue Apr 26 19:38:31 UTC 2011
Author: trociny
Date: Tue Apr 26 19:38:30 2011
New Revision: 221076
URL: http://svn.freebsd.org/changeset/base/221076
Log:
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
Modified:
head/sbin/hastd/control.c
head/sbin/hastd/control.h
head/sbin/hastd/hastd.c
Modified: head/sbin/hastd/control.c
==============================================================================
--- head/sbin/hastd/control.c Tue Apr 26 19:22:54 2011 (r221075)
+++ head/sbin/hastd/control.c Tue Apr 26 19:38:30 2011 (r221076)
@@ -162,7 +162,7 @@ control_status_worker(struct hast_resour
* 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
Modified: head/sbin/hastd/control.h
==============================================================================
--- head/sbin/hastd/control.h Tue Apr 26 19:22:54 2011 (r221075)
+++ head/sbin/hastd/control.h Tue Apr 26 19:38:30 2011 (r221076)
@@ -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;
Modified: head/sbin/hastd/hastd.c
==============================================================================
--- head/sbin/hastd/hastd.c Tue Apr 26 19:22:54 2011 (r221075)
+++ head/sbin/hastd/hastd.c Tue Apr 26 19:38:30 2011 (r221076)
@@ -424,7 +424,7 @@ resource_reload(const struct hast_resour
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");
More information about the svn-src-head
mailing list