Changeset 4552 for trunk/Ohana/src/opihi/pantasks/controller_check.c
- Timestamp:
- Jul 14, 2005, 8:18:09 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pantasks/controller_check.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pantasks/controller_check.c
r4539 r4552 1 1 # include "scheduler.h" 2 2 3 int controller_ host(int argc, char **argv) {3 int controller_check (int argc, char **argv) { 4 4 5 5 int status; … … 7 7 IOBuffer buffer; 8 8 9 if (argc != 3) { 10 fprintf (stderr, "USAGE: controller host (hostname)\n"); 11 return (FALSE); 9 if (argc != 3) goto usage; 10 if (strcasecmp (argv[2], "JOB") && 11 strcasecmp (argv[2], "HOST")) goto usage; 12 13 /* check if controller is running */ 14 status = CheckControllerStatus (); 15 if (!status) { 16 fprintf (stderr, "controller is not running\n"); 17 return (TRUE); 12 18 } 13 19 14 /* start controller connection (if needed) */ 15 StartController (); 16 17 sprintf (command, "host %s", argv[2]); 20 sprintf (command, "check %s %s", argv[2], argv[3]); 18 21 InitIOBuffer (&buffer, 0x100); 19 22 status = ControllerCommand (command, CONTROLLER_PROMPT, &buffer); … … 32 35 case CONTROLLER_GOOD: 33 36 fprintf (stderr, "controller command sent\n"); 37 fwrite (buffer.buffer, 1, buffer.Nbuffer, stderr); 34 38 return (TRUE); 35 39 … … 41 45 fprintf (stderr, "programming error: should not reach here\n"); 42 46 exit (1); 47 48 usage: 49 fprintf (stderr, "USAGE: controller check job (jobID)\n"); 50 fprintf (stderr, "USAGE: controller check host (hostID)\n"); 51 return (FALSE); 43 52 }
Note:
See TracChangeset
for help on using the changeset viewer.
