IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 1, 2005, 4:54:17 AM (21 years ago)
Author:
eugene
Message:

moved sched/scheduler to psched

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pantasks/LocalJob.c

    r4691 r4693  
    1 # include "scheduler.h"
     1# include "psched.h"
    22
    33/* this could be written a just a one-way pipe */
     
    6666  CheckLocalJobStatus (job);
    6767
    68   /* read stdout buffer */
    69   Nread = ReadtoIOBuffer (&job[0].stdout, job[0].stdout_fd);
    70   switch (Nread) {
    71     case -2:  /* error in read (programming error?  system level error?) */
    72       fprintf (stderr, "serious IO error\n");
    73       exit (2);
    74     case -1:  /* no data in pipe */
    75       break;
    76     case 0:   /* pipe is closed */
    77       /** change child state? **/
    78       break;
    79     default:  /* data in pipe */
    80       break;
    81   }
     68  if ((job[0].state == JOB_EXIT) || (job[0].state == JOB_CRASH)) {
     69    EmptyIOBuffer (&job[0].stdout, job[0].stdout_fd);
     70    EmptyIOBuffer (&job[0].stderr, job[0].stderr_fd);
     71  } else {
     72    /* read stdout buffer */
     73    Nread = ReadtoIOBuffer (&job[0].stdout, job[0].stdout_fd);
     74    switch (Nread) {
     75      case -2:  /* error in read (programming error?  system level error?) */
     76        fprintf (stderr, "serious IO error\n");
     77        exit (2);
     78      case -1:  /* no data in pipe */
     79      case 0:   /* pipe is closed, change child state? **/
     80      default:  /* data in pipe */
     81        break;
     82    }
    8283 
    83   /* read stderr buffer */
    84   Nread = ReadtoIOBuffer (&job[0].stderr, job[0].stderr_fd);
    85   switch (Nread) {
    86     case -2:  /* error in read (programming error?  system level error?) */
    87       fprintf (stderr, "serious IO error\n");
    88       exit (2);
    89     case -1:  /* no data in pipe */
    90       break;
    91     case 0:   /* pipe is closed */
    92       /** change child state? **/
    93       break;
    94     default:  /* data in pipe */
    95       break;
     84    /* read stderr buffer */
     85    Nread = ReadtoIOBuffer (&job[0].stderr, job[0].stderr_fd);
     86    switch (Nread) {
     87      case -2:  /* error in read (programming error?  system level error?) */
     88        fprintf (stderr, "serious IO error\n");
     89        exit (2);
     90      case -1:  /* no data in pipe */
     91      case 0:   /* pipe is closed, change child state? **/
     92      default:  /* data in pipe */
     93        break;
     94    }
    9695  }
    9796  return (TRUE);
     
    101100
    102101  int result, waitstatus;
     102
     103  /*** if child has exited, does the pipe hang around until it is flushed? ***/
     104  /*** who closes the child stdout/stderr fd? */
    103105
    104106  /* check local job status */
Note: See TracChangeset for help on using the changeset viewer.