Index: /trunk/Ohana/src/opihi/pcontrol/CheckDoneJob.c
===================================================================
--- /trunk/Ohana/src/opihi/pcontrol/CheckDoneJob.c	(revision 20065)
+++ /trunk/Ohana/src/opihi/pcontrol/CheckDoneJob.c	(revision 20066)
@@ -12,6 +12,18 @@
   ASSERT (job == (Job *) host[0].job, "invalid job");
 
+  // we have four possible states here:
+  // 1) stdout & stderr not yet requested
+  // 2) stdout requested, not yet completed
+  // 3) stdout completed, stderr not yet requested
+  // 4) stdout completed, stderr requested, stderr not yet completed
+
+  // we can always call this for stdout (if it is done, this is a NOP)
   status1 = GetJobOutput ("stdout", host, &job[0].stdout);
-  status2 = GetJobOutput ("stderr", host, &job[0].stderr);
+
+  // we cannot try stderr until stdout is completed
+  status2 = PCLIENT_HUNG;
+  if (job[0].stdout.completed) {
+      status2 = GetJobOutput ("stderr", host, &job[0].stderr);
+  }
 
   if ((status1 == PCLIENT_DOWN) || (status2 == PCLIENT_DOWN)) {
@@ -37,5 +49,5 @@
     PutHost (host, PCONTROL_HOST_BUSY, STACK_BOTTOM);
     ASSERT (job[0].host, "host not set for job");
-    PutJob (job, PCONTROL_JOB_DONE, STACK_BOTTOM);
+    PutJobSetState (job, PCONTROL_JOB_DONE, STACK_BOTTOM, job[0].state); // keep the incoming state
     return (FALSE);
   }
