From f5c3ea024e29f9f6ade11b24b5982123e997938a Mon Sep 17 00:00:00 2001
From: gardners <paul@servalproject.org>
Date: Thu, 3 May 2012 15:23:05 +0930
Subject: [PATCH] added debug output to see whether we are getting data back
 from java side.

---
 monitor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/monitor.c b/monitor.c
index 935e4bd6..0000c733 100644
--- a/monitor.c
+++ b/monitor.c
@@ -224,6 +224,7 @@ int monitor_poll()
 	  break;
 	}
 	bytes=read(c->socket,&c->line[c->line_length],1);
+	if (bytes>0) WHYF("Read monitor byte 0x%02x",c->line[c->line_length]);
 	if (bytes==-1) {
 	  switch(errno) {
 	  case EAGAIN: case EINTR: 
@@ -243,7 +244,7 @@ int monitor_poll()
 	    }
 	  }
 	}
-	c->line_length+=bytes;
+	if (bytes>0) c->line_length+=bytes;
 	if (c->line[c->line_length-1]=='\n') {
 	  /* got command */
 	  c->line[c->line_length]=0; /* trim new line for easier parsing */