Changeset 3203 for trunk/Ohana/src/opihi/pcontrol/host.c
- Timestamp:
- Feb 12, 2005, 9:34:34 AM (21 years ago)
- File:
-
- 1 edited
-
trunk/Ohana/src/opihi/pcontrol/host.c (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Ohana/src/opihi/pcontrol/host.c
r3189 r3203 3 3 int host (int argc, char **argv) { 4 4 5 int pid, status; 5 int N, Delete, Off, On; 6 Host *host; 6 7 7 /* this section needs some help: find the specified host in the queues */8 /* this section needs some help: find the specified host in the stacks */ 8 9 Delete = FALSE; 9 10 if ((N = get_argument (argc, argv, "-delete"))) { … … 12 13 } 13 14 14 /* this section needs some help: find the specified host in the queues */15 /* this section needs some help: find the specified host in the stacks */ 15 16 Off = FALSE; 16 17 if ((N = get_argument (argc, argv, "-off"))) { … … 29 30 30 31 if (Delete) { 31 host = FindHost (argv[1], PCONTROL_HOST_OFF);32 if ( host == NULL) {32 N = FindNamedHost (argv[1], PCONTROL_HOST_OFF); 33 if (N < 0) { 33 34 fprintf (stderr, "host %s is not OFF\n", argv[1]); 34 35 return (FALSE); 35 36 } 37 host = GetHost (PCONTROL_HOST_OFF, N); 36 38 DelHost (host); 37 39 return (TRUE); … … 45 47 } 46 48 host = GetHost (PCONTROL_HOST_OFF, N); 47 PutHost (host, PCONTROL_HOST_DOWN, QUEUE_BOTTOM);49 DownHost (host); 48 50 return (TRUE); 49 51 } … … 52 54 N = FindNamedHost (argv[1], PCONTROL_HOST_IDLE); 53 55 if (N >= 0) { 54 host = GetHost (PCONTROL_HOST_OFF, N); 55 PutHost (host, PCONTROL_HOST_OFF, QUEUE_BOTTOM); 56 host = GetHost (PCONTROL_HOST_IDLE, N); 57 CLOSE (host[0].stdin); 58 CLOSE (host[0].stdout); 59 CLOSE (host[0].stderr); 60 PutHost (host, PCONTROL_HOST_OFF, STACK_BOTTOM); 56 61 return (TRUE); 57 62 } 58 63 N = FindNamedHost (argv[1], PCONTROL_HOST_DOWN); 59 64 if (N >= 0) { 60 host = GetHost (PCONTROL_HOST_ OFF, N);61 PutHost (host, PCONTROL_HOST_OFF, QUEUE_BOTTOM);65 host = GetHost (PCONTROL_HOST_DOWN, N); 66 PutHost (host, PCONTROL_HOST_OFF, STACK_BOTTOM); 62 67 return (TRUE); 63 68 } 64 69 N = FindNamedHost (argv[1], PCONTROL_HOST_BUSY); 65 70 if (N >= 0) { 66 host = GetHost (PCONTROL_HOST_OFF, N); 67 PutHost (host, PCONTROL_HOST_OFF, QUEUE_BOTTOM); 71 host = GetHost (PCONTROL_HOST_BUSY, N); 72 host[0].markoff = TRUE; 73 PutHost (host, PCONTROL_HOST_BUSY, STACK_BOTTOM); 68 74 return (TRUE); 69 75 }
Note:
See TracChangeset
for help on using the changeset viewer.
