Index: /branches/eam_branches/ipp-20111122/Ohana/src/libdvo/src/HostTable.c
===================================================================
--- /branches/eam_branches/ipp-20111122/Ohana/src/libdvo/src/HostTable.c	(revision 33543)
+++ /branches/eam_branches/ipp-20111122/Ohana/src/libdvo/src/HostTable.c	(revision 33544)
@@ -301,5 +301,4 @@
 	// check on the status of this and report any output?
 	fprintf (stdout, "job finished for %s (%d)\n", host->hostname, pid);
-	close (host->stdio[HOST_STDIN]);
 
 	// read stdout
@@ -308,5 +307,4 @@
 	write (STDOUT_FILENO, host->stdout.buffer, host->stdout.Nbuffer);
 	FlushIOBuffer (&host->stdout);
-	close (host->stdio[HOST_STDOUT]);
 	fprintf (stdout, "\n");
 	    
@@ -316,5 +314,4 @@
 	write (STDOUT_FILENO, host->stderr.buffer, host->stderr.Nbuffer);
 	FlushIOBuffer (&host->stderr);
-	close (host->stdio[HOST_STDERR]);
 	fprintf (stdout, "\n");
 
@@ -343,4 +340,13 @@
 
 escape:
+
+  // close all opened connections
+  for (i = 0; i < table->Nhosts; i++) {
+    if (!table->hosts[i].pid) continue; // any unconnected hosts should be skipped
+    close (table->hosts[i].stdio[HOST_STDIN]);
+    close (table->hosts[i].stdio[HOST_STDOUT]);
+    close (table->hosts[i].stdio[HOST_STDERR]);
+  }
+
   return globalStatus;
 }
