Index: /branches/eam_branches/ipp-20111122/Ohana/src/libdvo/src/HostTable.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/libdvo/src/HostTable.c	(revision 33477)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/libdvo/src/HostTable.c	(revision 33478)
@@ -234,5 +234,5 @@
     timeout.tv_usec = 500000;
 
-    int status = select (Nmax, &rdSet, &wtSet, NULL, &timeout);
+    int status = select (Nmax, NULL, &wtSet, NULL, &timeout);
     if (status == -1) {
       perror("select()");
@@ -251,7 +251,9 @@
 	// this host has waiting output : read to buffer, and dump if necessary
 	ReadtoIOBuffer (&table->hosts[i].stdout, table->hosts[i].stdio[HOST_STDOUT]);
-	if (table->hosts[i].stdout.Nbuffer > 0x10000) {
+	// if (table->hosts[i].stdout.Nbuffer > 0x10000) {
+	if (table->hosts[i].stdout.Nbuffer > 0x1000) {
 	  fprintf (stdout, "--- stdout from %s ---\n", table->hosts[i].hostname);
 	  write (STDOUT_FILENO, table->hosts[i].stdout.buffer, table->hosts[i].stdout.Nbuffer);
+	  FlushIOBuffer (&table->hosts[i].stdout);
 	  fprintf (stdout, "\n");
 	}
@@ -261,7 +263,9 @@
 	// this host has waiting output : read to buffer, and dump if necessary
 	ReadtoIOBuffer (&table->hosts[i].stderr, table->hosts[i].stdio[HOST_STDERR]);
-	if (table->hosts[i].stderr.Nbuffer > 0x10000) {
+	// if (table->hosts[i].stderr.Nbuffer > 0x10000) {
+	if (table->hosts[i].stderr.Nbuffer > 0x1000) {
 	  fprintf (stdout, "--- stderr from %s ---\n", table->hosts[i].hostname);
 	  write (STDOUT_FILENO, table->hosts[i].stderr.buffer, table->hosts[i].stderr.Nbuffer);
+	  FlushIOBuffer (&table->hosts[i].stderr);
 	  fprintf (stdout, "\n");
 	}
@@ -274,7 +278,7 @@
       int pid = waitpid (-1, &status, WNOHANG);
       if (!pid) {
+	// fprintf (stderr, "no hosts to harvest\n");
+	usleep (500000);
 	break; // no outstanding jobs have finished 
-	fprintf (stderr, "no hosts to harvest\n");
-	usleep (500000);
       }
       if ((pid == -1) && (errno == ECHILD)) goto escape; // no more jobs on which to wait
@@ -298,4 +302,5 @@
 	fprintf (stdout, "--- stdout from %s ---\n", table->hosts[j].hostname);
 	write (STDOUT_FILENO, table->hosts[j].stdout.buffer, table->hosts[j].stdout.Nbuffer);
+	FlushIOBuffer (&table->hosts[i].stdout);
 	fprintf (stdout, "\n");
 	    
@@ -304,4 +309,5 @@
 	fprintf (stdout, "--- stderr from %s ---\n", table->hosts[j].hostname);
 	write (STDOUT_FILENO, table->hosts[j].stderr.buffer, table->hosts[j].stderr.Nbuffer);
+	FlushIOBuffer (&table->hosts[i].stderr);
 	fprintf (stdout, "\n");
 
