Index: trunk/Ohana/src/opihi/pantasks/JobOps.c
===================================================================
--- trunk/Ohana/src/opihi/pantasks/JobOps.c	(revision 4706)
+++ trunk/Ohana/src/opihi/pantasks/JobOps.c	(revision 4714)
@@ -39,4 +39,19 @@
   for (i = 0; i < Njobs; i++) {
     if (jobs[i][0].JobID == JobID) {
+      return (jobs[i]);
+    }
+  }
+  return (NULL);
+}  
+
+/* return job with given controller Job ID */
+Job *FindControllerJob (int JobID) {
+
+  int i;
+
+  /* return job with matching JobID */
+  for (i = 0; i < Njobs; i++) {
+    if (jobs[i][0].mode == JOB_LOCAL) continue;
+    if (jobs[i][0].pid  == JobID) {
       return (jobs[i]);
     }
@@ -96,4 +111,7 @@
      need to have matched entries to these quantites in the job structure */
 
+  InitIOBuffer (&job[0].stdout, 0x100);
+  InitIOBuffer (&job[0].stderr, 0x100);
+
   jobs[Njobs] = job;
   Njobs ++;
@@ -117,4 +135,8 @@
   }
   free (job[0].argv);
+
+  FreeIOBuffer (&job[0].stdout);
+  FreeIOBuffer (&job[0].stderr);
+  free (job);
   return;
 }
@@ -161,5 +183,5 @@
   gettimeofday (&job[0].start, (void *) NULL);
   job[0].last = job[0].start;
-  
+  job[0].state = JOB_PENDING;
   return (TRUE);
 }
