svn commit: r252818 - in stable/9/sbin: hastctl hastd
Mikolaj Golub
trociny at FreeBSD.org
Fri Jul 5 18:44:11 UTC 2013
Author: trociny
Date: Fri Jul 5 18:44:10 2013
New Revision: 252818
URL: http://svnweb.freebsd.org/changeset/base/252818
Log:
MFC r252472:
Make hastctl(1) ('list' command) output a worker pid.
Reviewed by: pjd
Modified:
stable/9/sbin/hastctl/hastctl.c
stable/9/sbin/hastd/control.c
Directory Properties:
stable/9/sbin/hastctl/ (props changed)
stable/9/sbin/hastd/ (props changed)
Modified: stable/9/sbin/hastctl/hastctl.c
==============================================================================
--- stable/9/sbin/hastctl/hastctl.c Fri Jul 5 18:31:26 2013 (r252817)
+++ stable/9/sbin/hastctl/hastctl.c Fri Jul 5 18:44:10 2013 (r252818)
@@ -293,6 +293,7 @@ control_set_role(struct nv *nv, const ch
static int
control_list(struct nv *nv)
{
+ pid_t pid;
unsigned int ii;
const char *str;
int error, ret;
@@ -331,6 +332,9 @@ control_list(struct nv *nv)
str = nv_get_string(nv, "status%u", ii);
if (str != NULL)
printf(" status: %s\n", str);
+ pid = nv_get_int32(nv, "workerpid%u", ii);
+ if (pid != 0)
+ printf(" workerpid: %d\n", pid);
printf(" dirty: %ju (%NB)\n",
(uintmax_t)nv_get_uint64(nv, "dirty%u", ii),
(intmax_t)nv_get_uint64(nv, "dirty%u", ii));
Modified: stable/9/sbin/hastd/control.c
==============================================================================
--- stable/9/sbin/hastd/control.c Fri Jul 5 18:31:26 2013 (r252817)
+++ stable/9/sbin/hastd/control.c Fri Jul 5 18:44:10 2013 (r252818)
@@ -271,6 +271,7 @@ control_status(struct hastd_config *cfg,
nv_add_string(nvout, compression_name(res->hr_compression),
"compression%u", no);
nv_add_string(nvout, role2str(res->hr_role), "role%u", no);
+ nv_add_int32(nvout, res->hr_workerpid, "workerpid%u", no);
switch (res->hr_role) {
case HAST_ROLE_PRIMARY:
More information about the svn-src-stable-9
mailing list