IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 18, 2006, 1:44:51 PM (20 years ago)
Author:
eugene
Message:

successful implementation of the threaded version of pcontrol

File:
1 edited

Legend:

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

    r7917 r8424  
    11# include "pcontrol.h"
    22
    3 int StartJob (Job *job) {
     3int StartJob (Job *job, Host *host) {
    44
    55  int  i, Nline, status;
    66  char *line, *p;
    7   Host *host;
    87  IOBuffer buffer;
    98
     
    1110
    1211  /* job must have assigned host */
    13   host = (Host *) job[0].host;
    14   if (host == NULL) {
    15     gprint (GP_ERR, "programming error: no assigned host\n");
    16     exit (1);
    17   }
     12  ASSERT (host == (Host *) job[0].host, "invalid host");
     13  ASSERT (job  == (Job *) host[0].job, "invalid job");
    1814
    1915  /* construct command line : job arg0 arg1 ... argN\n */
     
    4844
    4945    default:
    50       if (VerboseMode()) gprint (GP_ERR, "unknown status for pclient command: programming error\n"); 
    51       exit (1);
     46      ABORT ("unknown status for pclient command"); 
    5247  }
    5348
    5449  /* check on result of pclient command */
    5550  p = memstr (buffer.buffer, "STATUS", buffer.Nbuffer);
    56   if (p == NULL) {
    57     gprint (GP_ERR, "programming error: missing STATUS in pclient message\n");
    58     exit (1);
    59   }
     51  ASSERT (p != NULL, "missing STATUS in pclient message");
     52
    6053  sscanf (p, "%*s %d", &status);
    6154  switch (status) {
     
    6558
    6659    case -2:
    67       gprint (GP_ERR, "programming error: syntax error in pclient command\n");
    68       exit (1);
     60      ABORT ("syntax error in pclient command");
    6961
    7062    case -3:
    71       gprint (GP_ERR, "programming error: existing child on pclient\n");
    72       exit (1);
     63      ABORT ("existing child on pclient");
    7364
    7465    default:
     
    8172  }
    8273  /* we should never reach here */
    83   gprint (GP_ERR, "programming error: should not reach here (StartJob)\n");
    84   exit (1);
     74  ABORT ("should not reach here (StartJob)");
    8575
    8676failure:
    87   /* unlink host & job */
     77  // unlink host & job
    8878  job[0].host = NULL;
    8979  host[0].job = NULL;
     
    9484  return (FALSE);
    9585}
    96 
    97 /** note : host and job popped off stacks : can't use UnlinkJobAndHost **/
Note: See TracChangeset for help on using the changeset viewer.