Changeset 17475 for trunk/Ohana/src/opihi/pcontrol/ResetJob.c
- Timestamp:
- Apr 23, 2008, 11:35:39 AM (18 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pcontrol/ResetJob.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pcontrol/ResetJob.c
r16472 r17475 1 1 # include "pcontrol.h" 2 3 // XXX deprecated 2 4 3 5 int ResetJob (Job *job) { 4 6 5 7 int status; 6 IOBuffer buffer;7 8 Host *host; 8 9 … … 13 14 ASSERT (job != NULL, "host missing"); 14 15 15 InitIOBuffer (&buffer, 0x100);16 17 16 /* we have tried to reset the job; may not get status */ 18 17 job[0].Reset = TRUE; 19 18 20 status = PclientCommand (host, "reset" , PCLIENT_PROMPT, &buffer);19 status = PclientCommand (host, "reset"); 21 20 22 21 /* check on success of pclient command */ 23 22 switch (status) { 24 23 case PCLIENT_DOWN: 25 /*** different behavior for ANYHOST, WANTHOST, NEEDHOST? ***/ 26 gprint (GP_ERR, "host %s is down\n", host[0].hostname); 24 if (VerboseMode()) gprint (GP_ERR, "host %s is down\n", host[0].hostname); 27 25 HarvestHost (host[0].pid); 28 26 PutHost (host, PCONTROL_HOST_DOWN, STACK_BOTTOM); 29 FreeIOBuffer (&buffer);30 return (FALSE);31 32 case PCLIENT_HUNG:33 /*** should we consider a HUNG host DOWN? ***/34 gprint (GP_ERR, "host %s is not responding (ResetJob)\n", host[0].hostname);35 FreeIOBuffer (&buffer);36 27 return (FALSE); 37 28 38 29 case PCLIENT_GOOD: 39 gprint (GP_ERR, "message received (ResetJob)\n"); 40 FreeIOBuffer (&buffer); 30 host[0].response_state = PCONTROL_RESP_RESET_JOB; 31 host[0].response = PCLIENT_PROMPT; 32 FlushIOBuffer (&host[0].comms_buffer, 0x100); 33 PutHost (host, PCONTROL_HOST_RESP, STACK_BOTTOM); 41 34 return (TRUE); 42 35 43 36 default: 44 gprint (GP_ERR, "unknown status for pclient command: programming error\n"); 45 pcontrol_exit (55); 37 ABORT ("unknown status for pclient command"); 46 38 } 39 ABORT ("should not reach here (ResetJob)"); 40 } 47 41 48 gprint (GP_ERR, "programming error in ResetJob (should not reach here)\n"); 49 FreeIOBuffer (&buffer); 50 pcontrol_exit (56); 51 return (FALSE); 42 int ResetJobResponse (Host *host) { 43 44 int status; 45 IOBuffer *buffer; 46 47 /* job must have assigned host */ 48 ASSERT (host, "missing host"); 49 ASSERT (host[0].job, "missing job"); 50 buffer = host[0].comms_buffer; 51 52 gprint (GP_ERR, "message received (ResetJob)\n"); 53 return (TRUE); 52 54 } 53 55
Note:
See TracChangeset
for help on using the changeset viewer.
