From 120125784a1ca698c656c6ef5e21e219df994f64 Mon Sep 17 00:00:00 2001 From: ed Date: Fri, 19 Apr 2013 19:45:00 +0000 Subject: Add the Clang specific -Wmissing-variable-declarations to WARNS=6. This compiler flag enforces that that people either mark variables static or use an external declarations for the variable, similar to how -Wmissing-prototypes works for functions. Due to the fact that Yacc/Lex generate code that cannot trivially be changed to not warn because of this (lots of yy* variables), add a NO_WMISSING_VARIABLE_DECLARATIONS that can be used to turn off this specific compiler warning. Announced on: toolchain@ --- sbin/hastctl/Makefile | 1 + 1 file changed, 1 insertion(+) (limited to 'sbin/hastctl') diff --git a/sbin/hastctl/Makefile b/sbin/hastctl/Makefile index e7cd9cb..2be817e 100644 --- a/sbin/hastctl/Makefile +++ b/sbin/hastctl/Makefile @@ -21,6 +21,7 @@ MAN= hastctl.8 NO_WFORMAT= NO_WCAST_ALIGN= +NO_WMISSING_VARIABLE_DECLARATIONS= CFLAGS+=-I${.CURDIR}/../hastd CFLAGS+=-DHAVE_CAPSICUM CFLAGS+=-DINET -- cgit v1.1 From 761a3d22a7f983f7055431f4d002c59554d8df87 Mon Sep 17 00:00:00 2001 From: trociny Date: Sun, 21 Apr 2013 20:51:53 +0000 Subject: Remove code duplication. --- sbin/hastctl/hastctl.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) (limited to 'sbin/hastctl') diff --git a/sbin/hastctl/hastctl.c b/sbin/hastctl/hastctl.c index 883a298..6fe55fa 100644 --- a/sbin/hastctl/hastctl.c +++ b/sbin/hastctl/hastctl.c @@ -504,18 +504,8 @@ main(int argc, char *argv[]) nv_add_string(nv, argv[ii + 1], "resource%d", ii); break; case CMD_LIST: - /* Obtain verbose status of the given resources. */ - nv = nv_alloc(); - nv_add_uint8(nv, HASTCTL_CMD_STATUS, "cmd"); - if (argc == 0) - nv_add_string(nv, "all", "resource%d", 0); - else { - for (ii = 0; ii < argc; ii++) - nv_add_string(nv, argv[ii], "resource%d", ii); - } - break; case CMD_STATUS: - /* Obtain brief status of the given resources. */ + /* Obtain status of the given resources. */ nv = nv_alloc(); nv_add_uint8(nv, HASTCTL_CMD_STATUS, "cmd"); if (argc == 0) -- cgit v1.1 From f39c963dc20905c14324b9992ee87c4ad66a15e6 Mon Sep 17 00:00:00 2001 From: trociny Date: Sat, 11 May 2013 09:51:44 +0000 Subject: Get rid of libl dependency. We needed it only to provide yywrap. But yywrap is not necessary when parsing a single hast.conf file. Suggested by: kib Reviewed by: pjd --- sbin/hastctl/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'sbin/hastctl') diff --git a/sbin/hastctl/Makefile b/sbin/hastctl/Makefile index 2be817e..02531e6 100644 --- a/sbin/hastctl/Makefile +++ b/sbin/hastctl/Makefile @@ -32,8 +32,8 @@ CFLAGS+=-DINET6 CFLAGS+=-DYY_NO_UNPUT CFLAGS+=-DYY_NO_INPUT -DPADD= ${LIBL} ${LIBUTIL} -LDADD= -ll -lutil +DPADD= ${LIBUTIL} +LDADD= -lutil .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto -- cgit v1.1 From 5092fcd6407b7957943a19df1a41c997dce8a9cf Mon Sep 17 00:00:00 2001 From: trociny Date: Mon, 1 Jul 2013 18:41:07 +0000 Subject: Make hastctl(1) ('list' command) output a worker pid. Reviewed by: pjd MFC after: 3 days --- sbin/hastctl/hastctl.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'sbin/hastctl') diff --git a/sbin/hastctl/hastctl.c b/sbin/hastctl/hastctl.c index 6fe55fa..11b5b8d 100644 --- a/sbin/hastctl/hastctl.c +++ b/sbin/hastctl/hastctl.c @@ -293,6 +293,7 @@ control_set_role(struct nv *nv, const char *newrole) 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)); -- cgit v1.1