IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 20059


Ignore:
Timestamp:
Oct 10, 2008, 3:28:11 PM (18 years ago)
Author:
eugene
Message:

adding some ASSERTS to catch a thief

Location:
trunk/Ohana/src/opihi/pcontrol
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/opihi/pcontrol/CheckBusyJob.c

    r20047 r20059  
    5757  buffer = &host[0].comms_buffer;
    5858  job = (Job *) host[0].job;
     59  ASSERT (host == (Host *) job[0].host, "invalid host");
    5960
    6061  /** host is up, need to parse message **/
     
    8788    return (TRUE);
    8889  }
    89 
     90  ASSERT (outstate != PCONTROL_JOB_DONE, "impossible outstate for job");
    9091
    9192  /* parse the exit status and sizes of output buffers */
     
    9798  sscanf (p, "%*s %d", &job[0].stderr.size);
    9899
     100  ASSERT (job[0].stdout.size > 0, "job has no output?");
     101  ASSERT (job[0].stderr.size > 0, "job has no output?");
     102
    99103  // XXX runaway job if output too large?
    100104  if (job[0].stdout.size > 0x1000000) abort();
     
    105109  // don't unlink job and host yet
    106110  PutHost (host, PCONTROL_HOST_BUSY, STACK_BOTTOM);
     111  ASSERT (job[0].host, "host not set for job");
    107112  PutJobSetState (job, PCONTROL_JOB_DONE, STACK_BOTTOM, outstate);
    108113  gettimeofday (&job[0].stop, NULL);
  • trunk/Ohana/src/opihi/pcontrol/CheckDoneJob.c

    r20047 r20059  
    3636  if ((status1 == PCLIENT_HUNG) || (status2 == PCLIENT_HUNG)) {
    3737    PutHost (host, PCONTROL_HOST_BUSY, STACK_BOTTOM);
     38    ASSERT (job[0].host, "host not set for job");
    3839    PutJob (job, PCONTROL_JOB_DONE, STACK_BOTTOM);
    3940    return (FALSE);
     
    4546  host[0].job = NULL;
    4647  PutHost (host, PCONTROL_HOST_DONE, STACK_BOTTOM);
     48
     49  ASSERT ((job[0].state == PCONTROL_JOB_EXIT) || (job[0].state == PCONTROL_JOB_CRASH), "unexpected job state");
     50
    4751  PutJob (job, job[0].state, STACK_BOTTOM);
    4852
Note: See TracChangeset for help on using the changeset viewer.