[icinga-checkins] icinga.org: icinga-core/mfriedrich/workers: core: fix logical bug in handling log returned results first

git at icinga.org git at icinga.org
Sun Aug 5 23:32:13 CEST 2012


Module: icinga-core
Branch: mfriedrich/workers
Commit: 5f7eb89451e37076f412c8574d8417a7132e5698
URL:    https://git.icinga.org/?p=icinga-core.git;a=commit;h=5f7eb89451e37076f412c8574d8417a7132e5698

Author: Michael Friedrich <michael.friedrich at univie.ac.at>
Date:   Sun Aug  5 23:19:57 2012 +0200

core: fix logical bug in handling log returned results first

refs #2961
refs #2955

---

 base/workers.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/base/workers.c b/base/workers.c
index 9a4d866..7a5b032 100644
--- a/base/workers.c
+++ b/base/workers.c
@@ -449,7 +449,7 @@ static int handle_worker_result(int sd, int events, void *arg) {
 		wproc_result wpres;
 
 		/* log messages are handled first */
-		if (size < 5 && !memcmp(buf, "log=", 4)) {
+		if (size > 5 && !memcmp(buf, "log=", 4)) {
 			logit(NSLOG_INFO_MESSAGE, TRUE, "worker %d: %s\n", wp->pid, buf + 4);
 			continue;
 		}
@@ -560,7 +560,7 @@ static int handle_worker_result(int sd, int events, void *arg) {
 int workers_alive(void) {
 	int i, alive = 0;
 
-	if(!workers)
+	if (!workers)
 		return 0;
 
 	for (i = 0; i < num_workers; i++) {
@@ -675,7 +675,7 @@ static worker_process *get_worker(worker_job *job) {
  * worker
  */
 static int wproc_run_job(worker_job *job, icinga_macros *mac) {
-	struct kvvec kvv = KVVEC_INITIALIZER;
+	static struct kvvec kvv = KVVEC_INITIALIZER;
 	worker_process *wp;
 
 	/*





More information about the icinga-checkins mailing list