Index: /branches/eam_branches/ipp-20111122/Ohana/src/libdvo/src/HostTable.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/libdvo/src/HostTable.c	(revision 33481)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/libdvo/src/HostTable.c	(revision 33482)
@@ -289,36 +289,37 @@
 
       // find the host which has finished
-      int j;
       int found = FALSE;
-      for (j = 0; (j < table->Nhosts) && !found; j++) {
-	if (table->hosts[j].pid != pid) continue;
+      for (i = 0; (i < table->Nhosts) && !found; i++) {
+	if (table->hosts[i].pid != pid) continue;
 	found = TRUE;
 
+	HostInfo *host = &table->hosts[i];
+
 	// check on the status of this and report any output?
-	fprintf (stdout, "job finished for %s (%d)\n", table->hosts[j].hostname, pid);
+	fprintf (stdout, "job finished for %s (%d)\n", host->hostname, pid);
 
 	// read stdout
-	EmptyIOBuffer (&table->hosts[j].stdout, 100, table->hosts[j].stdio[HOST_STDOUT]);
-	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);
+	EmptyIOBuffer (&host->stdout, 100, host->stdio[HOST_STDOUT]);
+	fprintf (stdout, "--- stdout from %s ---\n", host->hostname);
+	write (STDOUT_FILENO, host->stdout.buffer, host->stdout.Nbuffer);
+	FlushIOBuffer (&host->stdout);
 	fprintf (stdout, "\n");
 	    
 	// read stderr
-	EmptyIOBuffer (&table->hosts[j].stderr, 100, table->hosts[j].stdio[HOST_STDERR]);
-	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);
+	EmptyIOBuffer (&host->stderr, 100, host->stdio[HOST_STDERR]);
+	fprintf (stdout, "--- stderr from %s ---\n", host->hostname);
+	write (STDOUT_FILENO, host->stderr.buffer, host->stderr.Nbuffer);
+	FlushIOBuffer (&host->stderr);
 	fprintf (stdout, "\n");
 
 	if (WIFEXITED(status)) {
 	  fprintf (stdout, "normal completion, exit status is %d\n", WEXITSTATUS(status));
-	  table->hosts[j].status = WEXITSTATUS(status);
-	  if (table->hosts[j].status) {
-	    fprintf (stdout, "job failed on %s\n", table->hosts[j].hostname);
+	  host->status = WEXITSTATUS(status);
+	  if (host->status) {
+	    fprintf (stdout, "job failed on %s\n", host->hostname);
 	  }
 	} else {
-	  table->hosts[j].status = -1;
-	  fprintf (stdout, "job exited abnormally on %s\n", table->hosts[j].hostname);
+	  host->status = -1;
+	  fprintf (stdout, "job exited abnormally on %s\n", host->hostname);
 	  continue;
 	}
