Changeset 8424 for trunk/Ohana/src/opihi/pcontrol/StartJob.c
- Timestamp:
- Aug 18, 2006, 1:44:51 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pcontrol/StartJob.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pcontrol/StartJob.c
r7917 r8424 1 1 # include "pcontrol.h" 2 2 3 int StartJob (Job *job ) {3 int StartJob (Job *job, Host *host) { 4 4 5 5 int i, Nline, status; 6 6 char *line, *p; 7 Host *host;8 7 IOBuffer buffer; 9 8 … … 11 10 12 11 /* 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"); 18 14 19 15 /* construct command line : job arg0 arg1 ... argN\n */ … … 48 44 49 45 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"); 52 47 } 53 48 54 49 /* check on result of pclient command */ 55 50 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 60 53 sscanf (p, "%*s %d", &status); 61 54 switch (status) { … … 65 58 66 59 case -2: 67 gprint (GP_ERR, "programming error: syntax error in pclient command\n"); 68 exit (1); 60 ABORT ("syntax error in pclient command"); 69 61 70 62 case -3: 71 gprint (GP_ERR, "programming error: existing child on pclient\n"); 72 exit (1); 63 ABORT ("existing child on pclient"); 73 64 74 65 default: … … 81 72 } 82 73 /* 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)"); 85 75 86 76 failure: 87 / * unlink host & job */77 // unlink host & job 88 78 job[0].host = NULL; 89 79 host[0].job = NULL; … … 94 84 return (FALSE); 95 85 } 96 97 /** note : host and job popped off stacks : can't use UnlinkJobAndHost **/
Note:
See TracChangeset
for help on using the changeset viewer.
